Brighton scored as many goals as Leeds (17th) and finished 9th. A quick scan of historical tables shows that these two results are not oddities. There are exactly two goals for a side in any game that actually matter to the result: the tying goal and the winning goal.
Insurance goals are great. They secure wins. Get them. By contrast, piling onto a team with the fourth, fifth, sixth and seventh goals is fun, but it very rarely translates into points or a cup win. Not all goals (or goals kept out) are created equal.
Burnley had nearly the exact same for/against numbers last season as the prior season (one less scored, two more kept out) and went down. They had three fewer wins, which was what cost them. It really is about scoring the right goals and keeping the right goals out. It's hard to have control over that, which is why teams both bolster their attack and bolster their defense in the hopes that scoring and denying goals well in general will lead to the desired result.
Teams that score well above the league average for goals don't get relegated. Teams that concede well below the league average don't get relegated. They are simply different varieties of "average to good team" if they aren't getting it done at the other end of the pitch. Teams that finish top four or lift silverware generally do at least one really well and the other at least well...unless they're Wigan Athletic.