Put call parity establishes the relationship between put and call prices for European options since they can be exercised only on the expiration date. Put call parity can also be used on American style options as long as you intend to hold them until the expiry date.
The theory states that the option premium for a call and put of an underlying security having the same strike price and expiration date should have a certain fair value, since the risk/ reward relationship between long call options and short put options for the same underlying at the same strike and expiry date correspondingly remain the same.
The pricing relationship further states that if there is a divergence between the fair value and the market value of the calls and puts, it would give rise to arbitrage opportunities until parity is restored.
Highlighted below is the formula to calculate put call parity-
C + X/ (1+r) ^t = P + S
C = Price of the call option
X = Strike price
r = Risk free rate
t = Time to expiry
P = Price of the put option
S = Spot price of the underlying security
Consider the left side of the equation as Portfolio-1 which comprises of a call option along with the strike price of the call and the right side of the equation as Portfolio-2, consisting of a put option and the underlying security.
As long as the values on both sides of the equation are equal, the put call parity holds true. However, if there is a variation in the value of the two portfolios + transaction costs, you can go long on the undervalued side and short the overvalued side of the portfolio.
In perfect markets, you will generally not find arbitrage opportunities and even if you do, they will arise only for a brief moment since arbitragers will quickly pounce on them and bring prices back to parity.