The concept FLAC uses is pretty simple: the input audio is split up into blocks and the audio in that block is approximated with one (simple) mathematical model per channel. This model is called a predictor. As this approximation isn't exact, the difference (the so-called residual) is also stored, this makes FLAC lossless.
When the predictor (the mathematical model) fits well to the audio data, the residual takes up much less space than the original audio data. In that case, the predictor removes redundancy from the signal. However, if a predictor is chosen that doesn't fit the audio data well, the residual takes up much more space than the original audio data. So, it is also possible to 'inflate' the data instead of compressing it!
However, finding the predictor that leads to the smallest residual is no easy task. There are a few different ways a suitable predictor can be found, but no method is 'the best'. It doesn't matter that the predictor isn't the best for FLAC to remain lossless: as long as the residual signal is the right one for that particular predictor, the data is stored losslessly.
This means that an old FLAC compressor might use a method that is superior to one in a new FLAC compressor (ffmpeg in this case). Perhaps it was found that the new method produces smaller files for 95% of all inputs, but larger files for 5% of the inputs.
Also, ffmpeg and FLAC have compression levels. Lower levels either limit the complexity of the predictor (for example to have faster decoding) or limit the way the encoder searches for the best predictor. Lower compression levels usually just pick a predictor and compress with that, higher compression levels usually try a few (or many) different predictors to find the best one. Trying all possible predictors would take hundreds of years for just a short audio file.