Despite, in spite of

Despite and in spite of have the same meaning and are prepositions.

We use despite / in spite of to express that something is unexpected or surprising.

despite something (noun)
despite + verb + -ing
despite the fact that

Despite the heavy traffic, we got there on time.
Despite
 being much older than the others, he won the race.

Despite and in spite of can be followed by a noun or verb. 

They can also be followed by 'the fact that' (less formal).

despite something (noun)
despite + verb + -ing
despite the fact that

in spite of something (noun)
in spite of + verb + -ing
in spite of the fact that

In spite of / despite the heavy traffic, we got there on time.
In spite of
 / despite the traffic being heavy, we got there on time. 
In spite of
 / despite the fact that he is much older than the others, he won the race.
In spite of
 / despite being much older than the others, he won the race.

Despite is used more often than in spite of in formal written English.

Subject

English