The reason this happens is because as you add more variable inputs to a given amount of fixed inputs, each unit of additional inputs helps you less, but still costs the same amount.
Think about the example of a 10 acre farm. The land is a fixed input and we'll say labor is the only variable input. As you add your first few workers, they do you a lot of good because they can help you work more efficiently. That means their marginal product is high (lots more produced for every unit of labor added) and marginal cost is low (because they are producing a lot their cost is divided over a lot of units of output).
Now lets say you keep adding laborers. At some point, they just get in each others way. At that point, the marginal product for each worker is low (they may not even help at all) and the marginal cost is high (you divide their wages over very little added product).
Does that make sense?
Marginal physical product (MPP) and marginal cost (MC)go in opposite direction as they are inverse of each other. This statement can be represented mathematically as:
MPP is proportional to 1/MC, or MC is proportional 1/MPP.
MPP is defined as the extra quantity of a product that can be produced from increasing the the quantity of a specified factor of production or input by 1 unit, when all other factors of production or inputs are held constant.
Thus MPP = (Increase in production)/(Increase in input)
MC is defined as the extra cost of production required to produce one extra unit of product.
Thus MC = (Increase in input cost)/(Increase in production)
We can see that in above equalities for MPP and MC, Increase in production appears as numerator for MPP and as denominator for MC. However there is some difference the other term. "Increase in quantity" appearing as denominator refers to only a single input, while "Increase in input cost" appearing in numerator of MC refers to cost of all the inputs used. But this total cost itself may be considered as the single input required for production.
Thus it is clear that a higher MPP signifies a lower MC, and a lower MPP signifies a higher MC. In other words MPP and MC move in opposite directions.