“In spite of” and “despite” both serve the same purpose grammatically. These prepositions link contrasting ideas. You can follow them with a noun, a gerund, or a pronoun, and then another clause to show contrast.
Let’s look at a few example sentences.
In spite of + noun + contrasting idea
In spite of the rain, I headed straight for the pool.
In spite of + gerund (-ing form of a verb) + contrasting idea
In spite of traveling all day, they still wanted to visit the lake.
In spite of + pronoun + contrasting idea
In spite of that, he answered the phone.
All of the examples above have the same meaning when you replace “in spite of” with the word “despite”. They also work no matter where you place the dependent prepositional phrase in the sentence. In other words, you can reframe any of the sentences above so that the prepositional phrase comes after the independent clause:
I headed straight for the pool in spite of the rain.
In addition to the grammatical structures listed above, native speakers employ an English grammar trick that enables them to use different parts of speech after “in spite of” and “despite”. They simply use the noun phrase “the fact that” to allow for more flexibility. Of course, non-native speakers can use this trick, too!
By introducing this construction, you can follow “in spite” or “despite” with a variety of different phrases rather than only nouns, pronouns, or gerunds. For example, imagine the independent clause, “There was bad weather.” You normally couldn’t follow “in spite of” with “there was bad weather”; however, when you add the phrase “the fact that,” the entire long phrase functions together as a single noun (a fact).
In spite of the fact that there was bad weather, we still ate outside.
This construction is common in the English language, but it’s not normally used for formal writing. In a more formal context, try shortening “the fact that there was bad weather” to “the bad weather” make the sentence more concise:
In spite of the bad weather, we still ate outside.