There are six regional accreditation bodies in the U.S. which recognize and provide accreditation for higher education based on their regional location in the United States. Online universities, too, get themselves accredited with any one or more of these regional bodies.
Getting an accreditation, whether online or on-campus, however, is completely voluntary and there is no legal or any other obligation to acquire one. For example, the University of People Project by the United Nations is not accredited by any of these regional accreditation bodies.
Many online universities have chosen not to get a regional accreditation from any of the regional accreditation bodies in the United States. Among others, the prime reason was to present itself as a global educational institute ready to challenge the status quo and offer affordable education to students around the world, including the countries with low-cost economies.