A lot of French words are reversed to create the slang term.
'Fête' in French means 'Party' now if you say the word and reverse it, it creates the word 'Teuf'. The word is written like it sounds, this is why it's written differently.
Ce soir on fait la teuf ! (Tonight the party is on)