I think you always select the best player in the draft. The value you gain from having a good player on a rookie is so high. But take a situation where you have 8-10 guys making over ten million on your cap. This might be a time to go for quantity in the draft as opposed to picking 25th or so. Trading down allows a team to select more rookie deal players who then take the spot of veterans who have higher minimum deals.
One thing I've noticed though is the Rams especially target a small number of players in the draft. They seem to go into the draft with 3 guys they really want and estimate where they will go and position themselves in the spot to take them. For example, Everett and Rapp. They passed on a lot of good players to specifically grab those two guys. Not saying they made a mistake just it adds some complexity to the best player vs need discussion.
I do believe that there is a point at which a team is making the correct decision to sacrifice quality of play for a lower cap number. Is Khalil Mack that much better than Nick Bosa/Josh Allen/Brian Burns to justify his cap number? Same with Donald and an Ed Oliver/Q.Williams. Not arguing either side but doing the analysis and determining where the breaking point is would be fun.