For example, if one enters canada or the United States by land, typically no stamp is applied to one's passport. However, if one enters Canada or the United States by air, typically a stamp is applied to one's passport. Why the difference?
In many cases, land crossings see a lot of back-and-forth cross border traffic, including a lot of people working or running errands across the border and crossing the border very often (sometimes multiple times a day). Cross-border commuters, really. Known in French as “frontaliers”.
This is especially true in border regions in Europe, but I suppose that also happens a lot for US/CA and US/MX borders.
Back when I was a kid living in CH, going to school in FR, due to the weird border layout, my father could cross the border 8 times a day or more… If they stamped every time, you would need a new passport every few months to accommodate all those stamps!
In many such situations a lot of the traffic is just waved through (especially if car plates allow easy identification of local traffic), so of course they won't stamp anyone they wave through. In some places where immigration officers are not allowed to go on strike, when they want to have some leverage in negotiations, they will actually start checking every single car going through the border (known in French as "grève du zèle"). Very long queues and chaos ensues.
Most border regulations make special cases to take into account that traffic, because it just wouldn't be possible to accommodate it using the "regular" rules.