In most legislations, software is copyrighted with the act of creation. The initial copyright holder is/are the developer(s), who may either transfer it or waive it altogether, placing it in the public domain (though the latter may not be possible in some legislations).
Unless the copyright holders have waived their copyright, any copying, modification or usage requires a license from the copyright holder, and the terms of the license determine the rights and obligations of both parties. This goes for both proprietary and FOSS software – what differs is the name given to the license agreement and the rights of its parties.
EULA is the term commonly used in connection with proprietary software. It is a "contractual extension to existing legislation" in that it is the kind of licensing agreement lawmakers originally had in mind: the licensee may use the copyrighted work subject to the terms and conditions of the agreement, and the copyright holder explicitly reserves all other rights. With commercial software licenses, the licensee typically receives a right to receive the software, but not to redistribute, modify or reverse-engineer it. Beyond that, most EULAs limit the liability of the copyright holder for any damage arising from the licensee's use of the product.
Agreements allowing viewing code, modification, redistribution etc. of proprietary sources do exist (typically between companies), but these are typically separate from the general EULA.
FOSS licenses work in a different way. Open-source licenses explicitly grant the licensee the right to use, redistribute, examine the source code of, and modify the software, thus effectively eliminating the "all (other) rights reserved" part and covering not only the scope of the EULA but also that of the specialized licenses mentioned before.
Free (or "copyleft") software licenses have two additional requirements over open-source licenses: distribution of executable binaries is only allowed under the condition that source code is also provided, and any modified versions of the software must be placed under the same license (some exceptions may apply, such as allowing other licenses of a similar spirit).
Both are more than just "contractual extensions to existing legislation": with an open-source license, the developers waive most (or all) of their exclusive rights. Free software licenses additionally use copyright as a vehicle to prevent works derived from the original software from being placed under a commercial license – neither of these was originally intended by the creators of copyright law, but these constructs are nonetheless possible and have since been tested in court.
Like an EULA, both free and open-source licenses frequently exclude liability. Unless the license states that certain uses (such as mere usage of the software) do not require acceptance of its terms, they effectively replace the EULA in governing the legal relationship between the copyright holder and the end user.
Aside from copyright, product liability issues need to be considered. Details depend on legislation, but eventually a FOSS developer cannot rule out being someday be held liable in some part of the world for their software malfunctioning. Therefore, the license would either need to include a liability exclusion that applies to end users even if they do not intend to modify or redistribute the software, or the developer would need to add an extra agreement which excludes liability to end users (note, though, that adding an extra agreement may not be compatible with the requirement of free software licenses to redistribute the software under the same license).
Disclaimer: I am not a lawyer.