You've had some great replies to this.
no. I want to know what it is about me that makes them think they can treat me like dirt.
The simple answer is that it's because you let them.
I know that sounds like 'victim blaming' but it's not. Victim blaming would be saying, "Well, people treat you like dirt because [insert flaws and inadequacies on your part]."
When the truth is that people will only treat you how you let them. That doesn't mean you can explain to them, reason with them, plead with them and get them to stop.
But it does mean that you stop accepting them and their behaviour in your life.
I should have walked away long before.
So do so. When you recognise that someone is doing it, walk away. Challenge them. Don't be too eager to please or be too accommodating.
In the same way that 'work expands to fill the time available', people behave to the limits of what they know is acceptable to a particular person. That is why they are not like it with everyone. You allow them to be like it with you.
To understand what they see in me that makes them realise they can do that. Not their motivations.
They don't fear you challenging them on it; they don't fear repercussions from you because there are none.
They don't value you because they don't think you value yourself.
what do you do to put your foot down? Walk away? Politely flag their poor behaviour to them?
It depends what you mean by polite. There's no need to go around kicking off at people (although those people seem to be rarely treated badly by others!) but setting clear boundaries for yourself so you know what you will and won't accept is crucial.