There is a principle called “Tadir v’she’eino tadir, Tadir kodem” - when presented with something commonly done and something less commonly done, the one that’s done more common takes precedence (Zevachim 89a et. al.).
What determines what is more common? For instance, on Rosh Chodesh Elul, do we say Barchi Nafshi before L’Dovid, since we say Barchi Nafshi during at least 11 months of the year, but we only say L’Dovid during 2? Or do we say L’Dovid first, since Barchi Nafshi is said on at most 20 days of the year, but L’Dovid is said on 51 days; alternatively, Barchi Nafshi is said at the conclusion of at most 20 tefillos, but L’Dovid is said at that of 102? In other words, if item A is more common than item B if you look at it one way, but item B is more common than item A if you look at it a different way, do we consider either one to take precedence, and if so, how to we determine which one?