Handlebar! The position of your hands relative to your feet is crucial because that is how you maneuver the bike over terrain. Especially with modern dropper posts, the position of the saddle is irrelevant when you're standing and throwing the bike up and over a ledge, sending a jump, scrambling over a rock garden, dropping a ledge, etc. In other words, most of the really fun and risky stuff is done standing up, so optimize the bike for that aspect of handling first.
IMO, most people end up with an overall reach/stack that is longer than would be ideal. This occurs because they set up the bike for maximum efficiency and comfort from a seated position. That's great if you're fitting a road bike, but we're not talking about road bikes here. The result is stable and confidence-inspiring at speed in the trainer or on a parking lot test ride but it zaps power from the ability to wrangle the bike around on climbs and technical terrain that is not flat and even.
After that, saddle height (distance from the BB to the saddle, or more specifically, to the top of the pedal at it's lowest position) is critical and really a non-negotiable constant for you on any bike you ride. Getting the saddle in the right position is about seated reach and optimizing distribution of your weight between the wheels. Depending on the seat tube angle on the bike, this might be hard to do on some bikes. This is why understanding stack and reach of a bike is more important than ETT and seat tube angles. You need to understand both to make a bike handle well from more than one position.
You can set the saddle height first so you have a pedalable position to start out, just don't fool yourself by basing your handlebar position solely on what is comfortable from a seated pedaling position, unless you are setting up the bike for riding that is mostly sitting like touring, commuting to work, maybe bike packing, etc.
in this regard, saddle position and handlebar position are two separate things. find out the best way to set up feet/hand relationship, then find your saddle height, then tweak each until you can find a compromise that is good for seated pedaling and stand-up wrangling.
Don't waste time chasing KOPS. It can be a useful point of reference to start out but it really has no scientific justification.