The word did in the second sentence is an example of do-support. This occurs because of the special role of auxiliary verbs in English. (I have changed the order of the examples for easier reading.)
English auxiliary verbs
Most verb phrases in English involve at least one AUXILIARY verb. These verbs appear before the main verb in the sentence. There are two main types. Firstly, there are the auxiliary verbs BE and HAVE. These appear in perfect, continuous, and passive constructions in English:
- I have eaten. (perfect)
- I am eating. (continuous)
- It is eaten. (passive)
Secondly, there is the family of modal auxiliary verbs. These are used to express ideas about permission, obligation, probability and so forth:
- You may leave.
- You must be polite to them.
- It might rain.
The nine central members of this group are: can, could, shall, should, may might, will, would and must.
The English auxiliary verbs have special grammatical functions, apart from the ones described above, which make them different from normal verbs. In particular, they play an important role in sentences featuring: Negation, Inversion, Code or Emphasis. (They are said, therefore, to have NICE properties).
Firstly, auxiliaries can take the adverb not (or contract with -n't) to form negative sentences. Normal verbs can't.
- He is not eating it / He hasn't eaten it/ He couldn't eat
- He ate not it/ aten't it * (wrong)
Secondly, some constructions in English require the subject and auxiliary verb to swap places. This is known as inversion. Normally, only auxiliary verbs can fullfil this function:
- Neither have I/Neither am I/ Neither can I.
- Neither travel I. * (wrong)
- Has she?/Is she?/Can she?
- Eats she? * (wrong)
In the following examples, the auxiliary verbs are said to be taking code. This means that they can appear stranded with the rest of the verb phrase omitted. The auxiliary seems to carry the meaning for the whole of the rest of the missing material. Lexical verbs can't do this:
- Have you ever been to Paris on a Friday evening with your mother-in-law?
- Yes, I have. (= been to Paris on a Friday evening with my mother-in-Law)
- Do you like listening to Northern soul?
- Yes, I like. * (wrong)
Lastly, we can stress auxiliaries in English when we want to add affirmative emphasis to our sentences. (We can also stress them for negative emphasis, but only when contracted with the negative particle):
- Cinderella shall go to the ball.
- I have finished my homework.
- I can do my five times table.
Simple tenses and do-support.
The present simple and past simple verb forms in English, do not standardly use auxiliaries for affirmative sentences:
- We worked.
- I like elephants.
Here we see the main verbs worked and like occurring on their own without any auxiliaries. However, suppose we need to use Negation, Inversion, Code or Emphasis? As we've seen, only auxiliaries can enter into such constructions. If we need to do this in the present or past simple, we need to use a 'dummy' auxiliary. The dummy for these purposes is the special auxiliary DO. It functions as an auxiliary stand-in in present simple and past simple constructions:
- I don't eat other animals. (negation)
- I like elephants. - So do I. (inversion)
- I do. (= take this man to be my lawful wedded husband) (code)
- I did finish my homework. (emphasis).
Note that when we use do the main verb is an infinitive and doesn't have tense.
These occurrences of the dummy auxiliary DO, only occur because an auxiliary is necessary for these constructions. It does not occur in unmarked affirmative sentences. The above examples all illustrate do-support, in other words they show DO standing in as an auxiliary verb.
The original sentences
I worked, then, is an unmarked, everyday, past simple sentence. There is no special reading here. The main verb carries the tense, and there is, as we would expect, no auxiliary.
The other sentence, however, is definitely marked. The presence of the dummy auxiliary is an indication that this is one of the NICE constructions. As the sentence does not involve negation, inversion, or code, the sentence is interpreted as being emphatic. There will be a sense that the affirmative truth of the sentence is being underlined. This may be occurring because there is some contrast with a negative expectation or assertion:
- You said I didn't work. I did work.
- I wasn't expecting to work, but I did work.
To sum up, although the literal meaning of the two sentences is the same, the version with do-support is marked as emphatic. The two sentences are not, therefore, interchangeable. If we used emphatic forms when we didn't need them, our English would sound very strange, and we might be misunderstood.