CDs came from a time when portable processing capability was relatively limited. Raw PCM data, such as what is on a normal CD or a normal PCM wav file is a direct representation of the audio waveform. It is extremely easy to reproduce the audio from, but doesn't make any attempt to limit it's size.
FLAC is a newer format which makes use of lossless compression to store the same exact data (lossless) but in a compressed manner so that it takes less space. A variety of techniques can be used to achieve lossless compression, but they effectively involve finding patterns in the data and then storing the pattern rather than every incidence of the pattern. This allows for potentially much smaller amounts of data to be used to represent the same stream, but it means that the decoder has to put the jigsaw puzzle back together before it can actually meaningfully play the file. This means that a player needs a lot more processing capability to play the audio back, but can use less space to store it.
Additionally, it has the disadvantage of not being a linear read. CDs were basically the digital equivalent of a record player. They could read the data linearly and play it back (hence Linear PCM) where as FLAC requires reading the entire file at once which wouldn't have worked for CDs in the early days even without the processing issues.
As for an example of how lossless compression can work in a general case, lets assume you had the following string
The elephant can see that the dog can see that the elephant is here.
We can notice that The, cat, see, can are all used multiple times, so we say:
1=the 2=elephant 3=see 4=can 5=that 124351dog43512is here.
As you can see, all the same information is there, but it took less space. The exact ways that patterns are recognized vary based on the format and type of data, but the result is still the same, the information density is increased resulting in the same amount of information stored in less space.