Little Red Riding Hood strayed from the path and ended up getting eaten by the Big Bad Wolf. When you stray, you wander off without paying attention to where you're going, and sometimes you get in trouble.
Stray can be used as a verb or as a noun. Your attention may stray when you're tired and listening to a very boring lecture. You may be the kind of person who brings home strays, the dogs and cats that have wandered away from their homes and are lost and hungry. When you're organizing your sock drawer and you've got one sock without a mate, you might find the stray sock left behind in the dryer.