You must sand your hardwood floors before staining or changing the colour. If you do not sand the wood floor, the polyurethane used in staining will not stick. This means that the new stain will not penetrate the wood.
The stain peels off if you try to apply it without sanding the hardwood. It is the only way you can change the colour of your wood floor.
Sanding the floor first removes waxes and oils on your floor. It eliminates wax residue from cleaning products and oils from your feet. These waxes and oils can jam the pores in the wood and limit the penetration of the stain and polyurethane.