When you're walking and you step on an area which has some kind of liquid or sticky thing, you have "stepped in" that substance.
For example, you can "step in":
- a puddle
- dog poop
- a spilled drink
- some used chewing gum
In contrast, you "step on" solid things:
I stepped on a piece of broken glass.