Why can the components of a mixture keep their identities but those in a compound cannot?
"Keep their identities" is a vague concept, so let's try to be a bit clearer about what we're saying here. Components of a mixture keep their chemical composition, while components of a compound do not.
The reason for this is quite simple:
Mixtures are just a bunch of stuff put together in the same place. Their molecules have very weak bonds between them, just enough to keep them in their current solid, liquid, or gaseous state.
Compounds are substances made when different atoms or molecules chemically bond into larger molecules. They also have the intermolecular bonds holding them in their solid, liquid, or gaseous state, but they also have much stronger chemical bonds within their molecules.
Actions like stirring and filtering generally can separate mixtures, but not compounds, because they are not fine-grained enough to break the tight chemical bonds within the compound.