Imagine something goes wrong on your server. Maybe a program gets stuck in an infinite loop and just keeps taking up more and more memory, or an attacker tricks you into installing something that runs a malicious script to hog all your resources.
When PHP processes get out of control, the memory limit serves to put a hard stop on that before they can crash your entire server or eat up all your allocated resources for the month.
Most legitimate PHP scripts are very small. Each individual script should only take up a tiny amount of RAM, unless you have an unusual program that needs more resources in one script than most programs will ever take as a whole. These types of plugins certainly exist, but they’re rare.
If you’re running out of memory, there’s a decent chance there’s a broken or malicious PHP program, and so the memory limit error kicks in.
But sometimes you really are using a large plugin that needs extra memory. Some web hosts also set the PHP memory limit very low, so that can cause the error to appear even when you’re not installing an exceptionally power-hogging application.
Either way, you’ll quickly encounter the memory exhausted error.