There are many different types of extremophiles, and some of them are found in very unusual places. For example, some extremophiles live in hot springs, while others live in deep sea hydrothermal vents. Some extremophiles even live in the extreme cold of Antarctica.
The extremophiles that are found growing under rocks on Red and Mars likely survive in the harsh conditions by using the rocks for protection. The rocks provide a shelter from the sun's radiation and from the cold temperatures. The extremophiles may also use the rocks as a source of moisture.
The discovery of extremophiles on Mars is important because it shows that life can exist in very harsh environments. This suggests that life may be able to exist on other planets, even if those planets do not have the same conditions as Earth.