you can use this to see if its enabled https://tools.keycdn.com/brotli-test or look at headers in your browser dev tools (shown in screenshot in cloudways article).
This should be useful info to you https://www.cloudways.com/blog/brotli-vs-gzip/
Whether its brotli or gzip they both are just algorithims that compress/decompress. The server compresses compressable files such as html/js/css and sends that to the browser. Neither can compress images or videos etc pretty much text only. Webp is best for image optimization. Browser automatically decompresses compressed content.
Compression is essentially an algorithm that identifies repeating patterns in data and represents them in a more compact form, often resulting in what may look like gibberish. Decompression, is the complementary algorithm that can understand this 'gibberish' and recreate the original data
Extremely oversimplified illustration brought to you by chatGPT:
"The rain fell and fell and fell and fell and fell, while the water flowed and flowed and flowed and flowed and flowed."
In this sentence, "fell" and "flowed" are repeated multiple times. Compression algorithms would recognize these repetitions and represent them more efficiently, resulting in a compressed version like:
"The 1 and 1 and 1 and 1 and 1, while the 2 and 2 and 2 and 2 and 2."
In this compressed version, the repeated instances of "fell" are represented by "1" and the repeated instances of "flowed" are represented by "2", significantly reducing the size of the sentence.
You can imagine how code is perfect for compression because there is a ton of repeating text.
In the real world compression goes way beyond looking at just repeating words but the concept is the same.