Great question — answering as the UphillTech team:
Assuming both bikes are in roughly the same condition... If you have a Trek bike and a Specialized bike from the same year that sold new at the same price point you will have roughly equivalent bikes. This is a rule of thumb not a law of physics. Each year bike makers - like Trek and Specialized - create a line of bikes. The line of bikes is designed to have a type of bike at the price points they think the public will buy and that will compete with other bike makers. So, they will have a range of mountain bikes, or road bikes, or gravel bikes at a range of price points that roughly match each other. If you compare a $1,000 - new, retail price (making this up, just an example) Trek mountain...
Full answer by David D: https://bicycles.stackexchange.com/a/95919 (CC BY-SA 4.0).
Need it done for your business? UphillTech.