Say we have 2 factories $A$ and $B$ producing the same product.
for a certain period in question we know how much product each factory produced, call it $n_A,n_B$.
the cost of producing each product in the factories is known to us, we call it $c_A,c_B$, but the price of the product $p$ is not yet known.
Is it possible to measure and quantify the factories effectiveness and profitability as a function of $c_A,c_B,n_A,n_B$ without knowing $p$ (not as a function of $p$)?
It is not necessarily possible to define the effectiveness/profit of each individual firm - the profits $\pi_A$ and $\pi_B$ of companies $A$ and $B$ respectively, are $\pi_A = p \cdot n_A - c_A(n_A)$, and $\pi_B = p \cdot n_B - c_B(n_B)$. However, we can $\textit{compare}$ the effectiveness of the two firms, and see how the quantities affect the relative effectiveness of each firm. To do this, write the above equations as $\pi_A + c_A(n_A) = p \cdot n_A$, and $\pi_B + c_B(n_B) = p \cdot n_B$. Dividing these two equations, we find that $$ \frac{\pi_A + c_A(n_A)}{\pi_B + c_B(n_B)} = \frac{n_A}{n_B} $$ or $$ \pi_A = \frac{n_A}{n_B} (\pi_B + c_B(n_B)) - c_A = \frac{n_A}{n_B} \pi_B + \frac{n_A}{n_B} c_B(n_B) - c_A(n_A) $$ The gives us a relationship between the profits of each firm. Using this, we can compare what happens to $\pi_A$ and $\pi_B$ as various quantities change. For example, holding all else constant, consider the impact of an increase in $n_A$. This can be captured by the following equation, called a comparative static: $$ \frac{\partial \pi_A}{\partial n_A} = \frac{\pi_B}{n_B} + \frac{c_B(n_B)}{n_B} - c_A'(n_A) $$ In the case that $c_A$ and $c_B$ represent the per unit cost of $n_A$ and $n_B$ respectively, we have that $c_A(n_A) = c_A \cdot n_A$. Then the above equation becomes $$ \frac{\partial \pi_A}{\partial n_A} = \frac{\pi_B}{n_B} + c_B - c_A $$ This tells us how much an increase in the production of firm $A$ will cause the profit of firm $A$ to change, in terms of the costs and productions of both firms, and the profit of firm $B$.
Now, everything is held constant and we only change $\pi_B$, then we obtain the equation $$ \frac{\partial \pi_A}{\partial \pi_B} = \frac{n_A}{n_B} $$ This might not make complete sense at first - how is it possible that we can hold $n_A$ and $C_A$ constant and still see a change in the profits of firm $A$? While firm $A$ hasn't changed anything about their production, we see that if the profits of firm $B$ change, then so do the profits of firm $A$. This is because $\pi_A$ and $\pi_B$ are actually implicitly dependent on price. That is, they are functions of $p$. What we have done is essentially to remove $p$ from the equations explicitly, while still allowing variables to depend on it implicitly, so that we can compare certain quantities to others. This is an essential idea in economics - it is often not possible to obtain an explicit solution for a variable such as profit, so we rather just compare how certain changes affect factors and profits. We can take this idea further: suppose that a firm gets to choose how much it produces, and that its costs depend on this choice. That is, firm $A$ will try to choose $n_A$ so that it maximizes profit: $$ \underset{n_A}{\max} \{ p n_A - c_A(n_A) \} $$ Here, $c_A$ is a function of $n_A$. If there exists a maximum in this equation (certain second order conditions hold), then the firm will choose $n_A$ so that $$ p = c'_A(n_A) $$ where $c'$ is the derivative of $c_A$ with respect to $n_A$. The same must be true of firm $B$: $$ p = c'_B(n_B) $$ So here we can say that given a price $p$, we can say the following about the costs and production of firm $A$ and $B$: $$ c'_A(n_A) = c'_B(n_B) $$ Again, in the case that the cost is just a per unit cost, $c_A(n_A) = c_A \cdot n_A$ and $c_B(n_B) = c_B \cdot n_B$, this situation does not work (the second order conditions are satisfied). In this case, we have that the profits of each firm are \begin{align*} \pi_A &= n_A(p - c_A) \\ \pi_B &= n_B(p - c_B) \\ \end{align*} It's easy to see what the firms will do in this case: if the price is less than the cost $c_A$, then the firm will not produce anything, since it is impossible for the firm to make profits. If the cost is equal to the price, then the firm will gain the same profit of zero producing any amount. If the price is greater than the cost, then the firm will produce an infinite amount. Thus, if the firms are allowed to choose their quantities, the problem is not very interesting. However, if the firms have already decided how much to produce, then we can use the comparative statics as mentioned above to analyze the effectiveness of each firm's decisions in comparison to the other.