Explained step by step
The cache is small, and when it fills up something has to go to make room: that's evicting. LRU (least recently used) removes the item nobody has used for the longest time. It's like your closet: if you haven't worn a jacket in 2 years, it's the first one you give away. The idea is that what hasn't been used in a long time probably won't be used again soon.
There are several ways to pick what to remove when the cache fills up. FIFO removes what came in first, like a supermarket line. LIFO removes what came in last. LRU removes what was used longest ago and MRU, the opposite, what was used most recently. LFU counts how many times each item was used and removes the least used. RR removes one at random. None is always best: it depends on how the data is used.
LFU (least frequently used) counts how many times each item was used and, when full, removes the one with the fewest uses. It's like a fridge: the sauce you use once a year goes before the milk you use every day. The difference from LRU: LRU looks at when it was last used; LFU looks at how many times in total. A very popular item nobody asked for in the last 5 minutes survives with LFU but can go with LRU.
A distributed cache pools the RAM of several networked computers and uses it as one big cache. It's like joining 4 neighbors' freezers to store the meat for a huge barbecue that doesn't fit in one. A single machine might have, say, 64 GB of memory; 10 together give 640 GB. That way the cache grows beyond one computer's limit.
A global cache is a single shared cache that all the app's servers use. If the data isn't there, the cache itself goes and fetches it from the database. It's like a shared fridge in an office: everyone takes from the same one, instead of each having their own. That way data one server fetched already serves the other 9, instead of each fetching it on its own.
A cache doesn't always help. If reading from the cache takes as long as reading from the database, it gains nothing. If requests almost never repeat, nearly everything is a miss. If data changes all the time, what's stored goes stale right away and you have to go to the database anyway. And it never works as permanent storage: it lives in volatile memory, which is wiped if the machine turns off, like what you write on a whiteboard.
Used well, a cache brings several advantages at once. It improves performance and lowers latency, because it answers in 1 ms instead of 50. It takes load off the database: if 9 of every 10 reads come from the cache, the database serves 10 times fewer. It lowers network cost and raises how many reads per second the system handles. It's used in databases, CDNs, DNS and APIs, with tools like Redis or Memcached.