The Emancipation Proclamation takes effect in Confederate territory. It proclaimed all those enslaved in Confederate territory to be forever free, and ordered the Army (and all segments of the Executive branch) to treat as free all those enslaved in ten states that were still in rebellion, thus applying to 3.1 million of the 4 million slaves in the U.S.
The Proclamation could not be enforced in areas still under rebellion, but as the army took control of Confederate regions, the slaves in those regions were emancipated rather than returned to their masters.
From 20,000 to 50,000 former slaves in regions where rebellion had already been subdued were immediately emancipated, and over 3 million more were emancipated as the Union army advanced. The Proclamation did not apply to the five slave states that were not in rebellion, nor to most regions already controlled by the Union army; emancipation there would come after separate state actions and/or the December 1865 ratification of the Thirteenth Amendment, which made slavery illegal everywhere in the U.S.
The Proclamation did not compensate the owners, did not itself outlaw slavery, and did not make the ex-slaves (called freedmen) citizens. It made the eradication of slavery an explicit war goal, in addition to the goal of reuniting the Union.
Read more about the proclamation at: Daily Black History Facts