Software is considered as a work of art in the eyes of the law, similar to a painting, a poem, or a movie script. As such, even if you share your art with the rest of the world to see, it does not mean that anyone can download it and use it as they please. Instead, they have a legal obligation to receive approval from the author who has copyrights on the software.
An open source license is a legal and binding contract between the author and the user declaring that the software can be used in commercial applications in certain conditions. The license is what turns plain old software components into open source components, and allows users to use that software as long as they keep to the specific terms and conditions as laid out in the license.