Besides the requirements of the electronics that is connected to the GPIO port, cost is normally an important factor in choosing a form of protection (if implemented at all).
The page you are referring to is a mix of various methods for various types of potential hazards. Input and Output is thrown together in one overview, without any notice for the usage of the described type of protection. I hope this page (which is under construction) categorizes it's chapters in the future a little better, because in this way it is pretty useless for in-experienced technicians, and just a summary of frequently used techniques.
But for every type of protection you need to find a balance between cost and effectiveness, you cannot protect against everything and still make something that is affordable.
All types of protection depend on factors, like:
- From what you do want protection ?
- Do you want input protection ?
- Do you want output (current limitation) protection ?
If you're just looking for some protection for normal level digital signals within a normal frequency spectrum, a general purpose buffer or general purpose opto-couplers will do just fine. Both (depending on type and how they are used) can work as input or output protection.
If you have special needs for protection, like:
- static discharge or lightning etc,
- very high frequencies,
- (very) high voltage signals,
- [a lot of other (more rare) requirements]
different types or protections/electronics are required that can have a totally different price tag then the couple of cents the normal buffers and optos cost.
So the question 'when and why' you're asking for is not a question with one answer, it depends on the context.