Cabinet shelves for the most part require very little maintenance. You stick them in the cabinet and the pretty much stay there unless you somehow damage them. Occasionally, a shelf might fall out of place.
Cabinet shelves use gravity to hold them in place. There are pegs that stick in pre-made holes in the side walls of the cabinets. The pegs slide into the holes and act as arms for the shelves to rest upon. So why would the shelves slip out of place?
Barring an impact to the shelf, it may be that the pegs are not level with one another. You find this when three pegs are on the same level, and one peg is too low. When you set something on the shelf, if it is placed just right it will cause the shelf to tip back or forward. Just make sure that all of the pegs are aligned on the same level set of holes.
Another possibility is that either the pegs are too short or that the shelf was cut too short. In either of these situations, there is the possibility that if the shelf moves too far to one side, it will fall off of the peg on the opposite side. You can cut a new shelf that is wider than the old one, or simply buy longer pegs so that when the shelf is pushed all the way to one side, the peg is long enough to support it.