exactly - even if they didn’t like the shade of pink (or blue, whatever) in your shirt that morning.
my wife was illegally terminated several years ago right after returning from our first child. it was blatant discrimination, her colleagues had been told not to talk to her, her desk had been given away before she returned, etc. basically her boss hated her for having her own mind, and not being subservient to him. we had spoken to attorneys and they all said something was fishy but since it was difficult to prove the specific scenarios which would break the law, it would probably be considered at-will termination.
its a totally unfair world when it comes to employer-employee relations. keep in mind, you also depend on the mercies of your past bosses and employers for references, etc. so basically, you are severely disadvantaged, no matter what anyone would have you think. plus, filing a suit means getting a reputation as a litigious employee, no matter how right you were and how wrong the company was.
i used to be idealistic, and think there are decent companies, etc. but its a bunch of crap. watch out for yourself and yourself alone - the company will dump you in no time if they feel any heat. its all need based. so operate at will from your side as well. keep developing your skills, and keep looking for better options. be loyal if and until it suits you and your plan.
sorry for busting the bubble for a lot of the younger ones out there, but this is how it works out there, don’t get taken advantage of. many may yet to have that first experience with the employer, but trust me it will happen to all of you at some stage.
FYI i have been with my current company for 6+ years and am doing pretty well with career progression et al. so this is based on careful, considered views.