Whenever we go from nominal to real terms, we need a base year. As an example, let's use 2016 as the base year. In the base year, the nominal wage $W$ is always equal to the real wage $w$ (this is true for any price or cost, not just wage). Also, we always set the price level $P$ equal to 1 in the base year. That's what makes it the base year.
Anyway, let's say that, in 2016, $w_{2016}=W_{2016}=15$. Suppose that, between 2016 and 2017, there's 2% inflation - that is, the price level $P$ increases by 2% from $P_{2016}=1$ to $P_{2017}=1.02$. Then, it follows that the real wage in 2017 will be $w_{2017}=\frac{W_{2016}}{P_{2017}}=\frac{15}{1.02}=14.706$. I hope this example helped.
In case it didn't, you can think about it like this: Dividing the nominal wage by the price level is just how you adjust for inflation, thus giving you the real wage.