In a complete market the absence of arbitrage implies the existence of an equivalent probability measure under which asset prices are martingales. The fair value of a derivative security that can be replicated with a dynamic hedging strategy can then be determined as an expected value under this measure.
Proving this in a continuous-time stochastic framework is complicated.
To get a sense of how this works, consider a simple discrete model to illustrate how a risk-neutral probability measure arises. Assume there are only two possible states of the market in a single time period -- with "real-world" probabilities $p$ and $1-p$, respectively. We consider the pricing of a call option on an asset with random price $S$.
At time $t=0$, the asset price is $S_0$ and the call option price is $C_0$, to be determined. At time $t=1$, there are two possible asset prices $S_{1u} = S_0(1+u)$ with probability $p$ and $S_{1d} = S_0(1+d)$ with probability $1-p$. The payoff of the option at expiration is
$$C_1 = \max(S_1-K,0), $$
where the random variable $S_1$ is $S_{1u}$ or $S_{1d}$ depending on the future state of the market:
$$C_{1u} = \max(S_{1u}-K,0)\\\ C_{1d} = \max(S_{1d}-K,0)$$
The value of the option at time $t=0$ is the discounted expected value of the payoff. However this expected value is not calculated with real probability $p$ -- but rather the risk-neutral probability $\hat{p}$ that preclude arbitrage opportunities.
We can determine the no-arbitrage risk-neutral probability $\hat{p}$ by showing it is possible to construct a hedged portfolio of the option and the asset that is risk free -- it has the same value in both future states. Hence the value of the portfolio grows in time at the risk-free rate of interest $i$.
Suppose the portfolio is long $1$ call option and short $\Delta$ shares of the asset. The value at time $t=1$ is
$$V_t= C_t-\Delta S_t.$$ We can solve for the hedge ratio $\Delta$ so that the value of the portfolio at time $t=1$ is independent of the state of the market:
$$C_{1u}-\Delta S_{1u}=C_{1d}-\Delta S_{1d},$$
or
$$C_1-\Delta S_1=C_{1u}-\Delta S_0(1+u)=C_{1d}-\Delta S_0(1+d).$$
This value of the hedge ratio is independent of the probabilities for the value of the asset at time $t=1$:
$$\Delta = \frac{C_{1u}-C_{1d}}{S_0(u-d)}$$
Consequently, in the absence of arbitrage, the portfolio grows at the risk-free rate:
$$C_1-\Delta S_1 = (C_0 - \Delta S_0)(1+i)$$
and we can solve for the value of the call option at time $t=0:$
$$C_0 -\Delta S_0= \frac{C_{1u}-\Delta S_0 (1+u)}{1+i},$$
$$C_0 = \frac{\Delta S_0 (1+i) +C_{1u}-\Delta S_0 (1+u)}{1+i},$$
$$C_0 = \frac{-\Delta S_0 (u-i) + C_{1u}}{1+i}.$$
Substituting for $\Delta$, we obtain
$$C_0 = \frac{\hat{p}C_{1u}+(1-\hat{p})C_{1d}}{1+i}=\frac{1}{1+i}\{\hat{p}\max[S_0(1+u)-K,0)]+(1-\hat{p})\max[S_0(1+d)-K,0)]\},$$
where
$$\hat{p} = \frac{i-d}{u-d}.$$
This has the form of an expected value with a different probability -- the risk-neutral probability. The fair value of the call option is the discounted expected value under the risk-neutral probability measure.