The key reason why the fairly competent, liberal and inclusive agenda lost time after time was that the people promoting it felt so self-important with their advanced degrees and great pedigrees that they felt that should be enough to win. That it will be enough to remind the voters that the other side is Bad and that's job done. The PiS party, in turn, was incredibly good at reaching voters, they spent ages building grassroots structures, including in unglamorous rural areas, where they remain very popular now. They have cohesive, very populist, but clear and catchy slogans nad programs. They have cultural clubs, newspapers, TV channels, everything.
The good news (if you're liberal) is that the centrist parties finally got organized, ran a common election platform and campaigned beyond "surely, you'll just all vote for us because we bothered to turn up to your smelly little town". Although whether they learnt they have to do that every time remains to be seen.