From Bulbapedia, the community-driven Pokémon encyclopedia.
A marsh tile is a special tile introduced in Pokémon Diamond and Pearl. It is found only around Pastoria City, Route 212, inside the Great Marsh, and in the Johto Safari Zone, all of which being the location of some form of wet ground. When the player walks on them, they may find that they are stuck and are unable move. Getting free requires the player to "struggle and squirm" by using the D-pad to repeatedly change the direction in which they are facing.
The marsh tiles on Route 212 are devoid of grass; no wild Pokémon are found there. Conversely, in the Great Marsh, wild Pokémon are only found in the marsh area, which has grass growing on top of the mud. Despite the grass there, players can still get stuck while moving through the bog. Battling while stuck can and will free the player.
A tile that works in a similar fashion is the Hole trap used in the Underground.