Slavery did not end in the United States on Juneteenth. Rather, the Emancipation Proclamation was posted in Galveston, TX, marking the end of slavery in Texas. Slavery remained legal in Kentucky and Delaware until the ratification of the 13th Amendment on December 18, 1865.
The emancipation was not a legal document. Lincoln didnt even have the prerogative to set rules governing to army for the freeing of captured slaves, as that (Setting rules for captures) was a Power delegated to Congress, not the President.