Insofar as there's any luck involved, it's less that Chelsea/Liverpool were bad (because as the posts above state, our points total is typically enough for top four regardless) and more that we got as many points as we did from our actual level of performances.
Whether you look at the goal tallies (fewest goals scored in the top six, second fewest in the top nine), the underlying stats (6th for xPTS and xGD) or just the eye test, we were generally on the right side of some very tight margins. If we put in this standard of performances every season, more often than not we come away with fewer points. We could improve quite a bit in real terms next season and still finish up in pretty much the same place in the league table.
But as we did manage to do what we did this season, that's only really a problem now if performances don't improve. Plus at least one factor was being spread thin across multiple competitions more than we typically will be.