Think of it like this. (Don’t get freaked out as you read this, it’s just an imaginary scenario. No one in their ‘right mind’ would actually do this.)
Suppose there was a dark room with one chair in it. You and your child walk into the room, and find the chair. Your child is instructed to sit on the chair and then you leave the room. Because your child is smart, she shimmies down off the chair and heads in the direction where she believes the door is. (She’s not crying. It would break my heart if she was crying, so since I’m writing this—she’s not crying!) When the child reaches the wall she let’s out a huge sigh of relief. She’s relieved that she’s touching the wall, the boundary.
Testing or misbehaving is a child’s way of seeking out, “What am I allowed to do, and not allowed to do?” Boundaries give her that answer by informing her of the direction she needs go. Now comes the test, will she follow that information aka boundary, or reject it.
By expressing, and possibly reminding a child what the boundry is, you’re saying, “This is my line in the sand. If you choose to ignore my line in the sand, then I will have to do something about it.” If you have to ‘do something about it’ use a natural consequence. The intensity of needing to repair the emotional or physical damage done by crossing the line in the sand is how a child learns to respect your requests, and the life skills needed to manage every day life.
BTW, understanding boundaries from a child’s point of view allows parents to enforce boundaries with loving-calm-firmness because you know she is learning, not doing this on purpose.