As far as I know -and have researched-, when Abraham Lincoln signed the Emancipation Proclamation, the status of 3.5 slaves were changed and they were free. If the Union and the Confederate states were in a war and -technically, at that time during the war- the Union did not have authority over the Confederate states, how were the slaves freed and how did the Executive Order take place under the Confederate government's presence.
(I am not American and have not learned this subject at school or in any form of formal education, I am just a curious person wanting to further increase my knowledge about North American culture and history)
Excellent question with a complex answer.
Lincoln claimed authority to issue an executive order that would apply to the Southern states because he did not recognize the legitimacy of the Confederacy or of the secession of the states in question. The Civil War was about the Union imposing its definition of the Constitution - where states could not leave - upon those states which contested that concept of a unified nation. Because Lincoln and Union forces sought to enforce the Constitution upon states in insurrection, they could not violate legitimate laws upheld under the Constitutional umbrella, and this included the legally-defined institution of slavery.
The issue of what to do with escaped or captured slaves came up very early at Fort Monroe on the southern coast of Virginia. The fort was well positioned to defend itself and never fell to Confederate forces, retaining its strategic position with guns overlooking the entrance to the Chesapeake Bay. On May 23, 1861, and the beginning of the Civil War, three fugitive slaves appeared at the gate of the fort. They had been directed to dig trenches on the shore side of the fort, to place the Union installation under siege. The slaves had no inspiration to assist their master in his effort to preserve the institution of slavery and they recognized an opportunity to escape. Col. Charles K. Mallory, who claimed ownership of the three men, appeared before the fort's gate and demanded their return under existing federal law. Maj. Gen. Benjamin F. Butler, the fort's commander (who was also a lawyer) declared that the slaves were contraband property, and just as he would not return a horse to forces in insurrection, neither would he return a slave.
Because Fort Monroe was located deep in the South, fugitive slaves began escaping to the installation, requesting sanctuary, which they were given, creating a large refugee camp of enslaved people who were legally not free, but who were nevertheless granted a place to reside away from their enslavement.
Union forces throughout the frontier applied the "contraband" concept first employed by Maj. Gen. Butler, but it was an incomplete solution to the problem, and if the war were to end suddenly, Union troops would have been legally required to return the "property" to their "owners."
Lincoln's Emancipation Proclamation gave captured and escaped slaves a new legal status, allowing them to be treated as free people rather than as confiscated property. There may have been little difference between the two statuses, but the executive order charted a more workable path forward. And, of course as you point out, Lincoln was not able to impose his edict over much of the South (at least at first), but whenever Union forces encountered enslaved people, they now had a means to deal with them.
The recent film "Lincoln," which focused on the passage of the 13th Amendment to the Constitution, outlawing slavery, was a long-term legal solution to what Lincoln's Proclamation attempted to achieve. (It was by Congress on January 31, 1865, and ratified on December 6, 1865, eight months after Lincoln's assassination). As the character Lincoln in the film expressed, his proclamation could be undone by a future administration, and the pestilence of slavery could once again become a problem confronting the nation. The only real solution was a Constitutional amendment.
At the time, however, the Emancipation Proclamation give Union troops very real authority to set free enslaved people wherever they found them in states in insurrection. That was a far better solution than the previous concept or confiscated contraband.