> It has to be valid
It doesn’t have to be valid. You can fire someone because you don’t like them, or for no reason at all.
You just can’t fire them for a prohibited reason, such as race, age over 40, sex, disability etc.
Needing a reason is more of a practical problem - every person is a member of at least two protected classes (everyone has a race and sex). If you have no reason for firing a person, it’s often pretty easy for them to argue it was really based on a protected characteristic.