What is the difference between satipatthana, samatha and anapanasati? When I read about them they all seem to be saying the same thing so how are they different?
Those three terms do have a lot of similarities when we apply them.
Anapanasati is a broad term translated as "mindfulness of breathing", it can refer to any type of breath-meditation where we apply mindfulness. In the anapanasati sutta it mentions being mindful of the body while you are breathing, therefore you don't have to be mindful of the breath directly.
Samatha means a calm state so samatha meditation is a type of meditation where we try to create calm. Often being aware of the breath is a way to create calm so this can appear similar to anapanasati.
The word satipathana means a foundation for mindfulness. This is a type of meditation where to aim to practice mindfulness of anything we choose. The satipathana sutta uses the body and feelings as examples of things we can be mindful of. If you don't have much calm then it can be good to be mindful of the breath because it is quite stable. This can be a type of anapanasati meditation; also notice how it is linked to creating calm (samatha meditation).
Those three types of meditation overlap a lot and sometimes we could use more than one of those words to describe what we are doing.
'Samatha' means' tranquility' or 'calmness'. It is one of two primary fruits of 'satipathana' (the 7th factor) & concentration/samadhi (the 8th factor of the noble eightfold path), the other fruit being vipassana (insight). MN 149 explains:
Any view belonging to one who has come to be like this is his right view. Any resolve, his right resolve. Any effort, his right effort. Any mindfulness, his right mindfulness. Any concentration, his right concentration: just as earlier his actions, speech & livelihood were already well-purified. Thus for him, having thus developed the noble eightfold path, the four frames of reference (satipatthana) go to the culmination of their development... the seven factors for Awakening go to the culmination of their development. [And] for him these two qualities occur in tandem: tranquillity (samatha) & insight (vipassana).
'Satipatthana' means 'establishment of mindfulness' and refers to establishing 'mindfulness' ('recollection' of the dhamma) in relation to sense experience. Thus the satipatthana suttas explain:
the meditator... is mindful — putting aside greed & distress with reference to the world.
The four noble truths tells us craving (greed & distress) create suffering and should be abandoned therefore the role of mindfulness is to remember to abandon greed & distress and meditate without greed & distress.
It is noticeable on Buddhist chatsites how many people are writing questions & posts that result from greed or distress in relation to meditation. It follows none of these people are practising Buddhist meditation correctly.
For example, observing breathing with greed or meditating with greed is not satipatthana; it is not mindfulness. Instead, it is the opposite of mindfulness, namely, the neglect or forgetting of the most basic dhamma principles that craving is to be abandoned.
'Anapanasati' means 'mindfulness with/when breathing'. It refers to the breathing becoming the 'sign' or 'mark' of right concentration, namely, the natural automatic arising of awareness (anupassi) of breathing when the mind is without craving & is quiet & silent.
'Anapanasati' does not mean 'mindfulness of breathing' because it is impossible to be mindful of breathing since the word 'sati' ('mindfulness') means 'to remember'. Breathing is not something that can be remembered.
This is why the suttas state the meditator 'observes' or 'contemplates' ('anupassi) the breathing rather than is 'mindful' ('sati') of the breathing.
As already quoted, the meditator is mindful to abandon greed & distress, as follows:
One is mindful to abandon wrong view & to enter & remain in right view: This is one's right mindfulness. MN 117
The 16 stages in the Anapanasati Sutta refer to the natural automatic fruition of meditation when right concentration has been established. Where as all of the various & disconnected practises in the Satipatthana Sutta is a later-day compilation of teachings for Buddhists who are beginners or who are practising meditation irregularly (rather than practising for many hours per day).
Ultimately, there is no difference between satipatthana & anapanasati, as stated in the Anapanasati Sutta, as follows:
Mindfulness with in-&-out breathing (anapansati) developed & pursued... bring the four frames of reference (satipatthana) to their culmination...
Sati-Paṭṭhāna = object-cause (ārammaṇa-paccaya) of sati-bhāvanā = object of sati development.
2 type of sati development's objects: samatha-paṭṭhāna & vipassanā-paṭṭhāna (samatha-kammaṭṭhāna&vipassanā-kammaṭṭhāna).
Samatha-paṭṭhāna = ānāpāna(ssati), paṭikūla(manasikāra), etc.
Vipassanā-paṭṭhāna = catudhātu(vavaṭṭhāna), vedanā(-kammaṭṭhāna), etc.
What is samatha?
Samatha is consciousness pause kilesa by thinking about samatha-paṭṭhāna.
What is vipassanā?
Vipassanā is consciousness destroy kilesa by thinking about vipassanā-paṭṭhāna.
Vipassanā must arise after samatha for regular people (neyya), who live with daily kilesa almost every time. Unless the perfect people (ugghaṭitaññū&vipacitaññū), who live with kusala more than kilesa.