Not everywhere, they aren't.
Some excerpts that you will find educational:
"Please note that where no state agency is listed below, there may be local licensing agencies that would have control ..."
"Illinois... no licensing of electricians at the state level, check with local jurisdictions"
"Indiana ... no licensing of electricians at the state level, check with local jurisdictions"
"Iowa ... The law requires that all individual contractors and businesses performing ?construction? work within Iowa be registered with the Division of Labor if they earn at least $2,000 a year from that work."
Kansas -- no state licensing agency listed
Mississippi -- no licensing information listed
"Missouri ... check with local jurisdictions for licensing info"
"New York ... check with local jurisdictions for electrical licensing requirements"
"Ohio ... licenses commercial contractors ... they do not license residential contractors ..."
"The Commonwealth of Pennsylvania has no requirements related to the registration, certification or licensure of contractors (or their employees) that are engaged in the construction industry. Some of Pennsylvania?s 2,565 municipalities have established local licensure or certification requirements for contractors or construction trades people. ... The Commonwealth has no jurisdiction in this matter ... "
So much for your blanket claim that "licenses are required by law." They are in many places, sure -- but this ought to make it clear to you that they certainly are *not* required everywhere.