A boulder fort is the strategic placement of boulders to control the generation or movement of monsters around you, taking advantage of the fact that few monsters can move onto boulders.
A basic use of a boulder fort is as a protection or escape tactic. You can read a blessed scroll of earth if an arch-lich is summoning too many monsters, or you can take out difficult monsters such as quest nemeses from behind a strategic boulder fort on the stairs up.
You can trap a temple priest in a boulder fort in order to convert the altar without interference.
Boulder forts are useful for extinctionism or farming, because they can force monsters to be created on (and able to attack you from) a certain spot, such as an altar. The keystroke sequence necessary for mass monster slaying becomes rather simple and less error-prone in a fort.
..... .000. .0_0. .0@0. .000. .....
Boulder forts are vulnerable to hostile monsters zapping wands of striking at you from outside and smashing the boulders. Ghosts, giants, and xorns can also move onto squares containing boulders. However, monsters cannot occupy the same square as one another, so for better security, some players opt for a boulder-jelly fort: a fort where the boulders sit on top of blue jellies (or other sessile monsters), which never move. This is still not foolproof, but it is pretty solid. For maximum (but still not foolproof) security, you may want to make a boulder-jelly fort where each jelly is sitting on a scroll of scare monster.