There are two main factors.
The law One, as other answers have mentioned, is the law .
There are strict regulations that cover everything in aviation, from the way people speak to the training they must have and the specifications and audit trails of almost every piece of equipment they use.
Now it's true that people, especially unscrupulous ones who are keen to save money and might be willing to take a few risks in order to do that, don't always obey they law or follow regulations to the letter.
And after all, there are laws against murder with much more significant penalties than for (for example) flying with a bit less fuel than the regulations say you should, and yet people persist in murdering.
The culture
However, the other factor is the culture .
A low-cost airline exists in the culture of aviation, not independently, and the culture puts safety first.
Each person working for the airline will have trained and may have worked outside the airline, and will already have acquired attitudes and ways of thinking that prioritise safety and adherence to regulation.
Each person working for the airline will be working with and encountering aviation industry individuals from outside the airline, on a daily basis - if they didn't share similar attitudes and ways of thinking, they'd stand out a mile, and so would a corporate culture that similarly failed to embrace the industry's culture of safety.
aviation.stackexchange.com/users/14197/Daniele Procida
Why can't low-cost carriers compromise for the safety of their passengers?
Because there are laws and regulations which keep passengers safe, and low-cost carriers are not exempt from those regulations.
aviation.stackexchange.com/users/8114/Terran Swett
Beside all the regulations that require certain maintenance action to be done on aircraft in order for the aircraft to remain air worthy, the simple answer is if LCC compromise safety in order to cut cost no one will want to fly with them and they will lose business.
aviation.stackexchange.com/users/679/vasin1987
An airline will need to have an 'Air Operator Certificate' (AOC) or something similar issued by the state.
In order to have such a certificate it has to show that its operations are in compliance with the national laws of the country.
There is also an 'Operations Specification' which details the type of operations the airline can carry out.
The respective manuals will need to be checked by the authorities and the actual operation will be audited.
For operations into other countries, the other country may require you to undergo a 'foreign operator air license' which will require a check of the manuals and possibly an audit.
The list of checks is endless and usually in the long run it is easier to follow than try to cut costs related to safety and security.
The airline can have its AOC suspended for unsafe operations until they fix the operations.
Other countries can ban certain countries from operating in their airspace if there are security concerns.
The EU, for instance, maintains a blacklist of airlines banned from entering their airspace.
aviation.stackexchange.com/users/26171/Anilv
Along with being illegal and potentially looking bad, generally, people's lives are in the balance but historically this has not always stopped the more unscrupulous airlines in the past.
Arguably Alaska Airlines cut corners that ultimately lead to the fatal crash and deaths of 58 people on flight 261 .
From the NTSB report: Alaska Airlines' maintenance and inspection of its horizontal stabilizer activation system was poorly conceived and woefully executed.
The failure was compounded by poor oversight...
Had any of the managers, mechanics, inspectors, supervisors or FAA overseers whose job it was to protect this mechanism done their job conscientiously, this accident cannot happen Cutting corners on training, improper cargo loading and generally poor handling of hazardous materials also lead to the fatal crash of ValuJet Flight 592 killing 110 people.
There is some interesting info on it in this paper from the FAA There has been push from various low cost carriers to introduce what is effectively standing room only aircraft or sections of aircraft for an even lower fare.
However this does not pass the seating requirements that the FAA/EASA generally have so no one has yet to actually bring it to market.
It will be interesting to see if they can ever push the regulation through.
aviation.stackexchange.com/users/3677/Dave
What prevents low-cost carriers from cutting corners that might compromise the safety of their passengers?
Airlines are required by the International Civil Aviation Organization (ICAO) to implement formal aviation safety management systems (SMS) .
This mandate came from November 2006.
It is up to each member state's civil aviation authority (FAA, Transport Canada, CASA, EASA, etc.) to provide oversight of all airlines' SMS.
Oversight is provided by audits that follow an industry-accepted SMS audit checklist .
When there are audit findings coming from their civil aviation authority (CAA), the airline has a limited number of days to return to compliance else their operating certificate may be revoked.
Fines may also be employed to urge the airline toward compliance and to reduce the chances that the operator will return to non-compliant behavior.
aviation.stackexchange.com/users/12542/Chris Howell
While not technically an answer: I just want to point out that (most) LCCs do not have the financial means and public image credit to survive even a single minor incident or crash.
A simple runway overrun or engine fire might be enough to literally bankrupt the company within days, and (most) LCC managers are painfully aware of that.
The incentive is therefore quite high to avoid any incidents and keep safety levels way above the minimum required by law.
aviation.stackexchange.com/users/419/Radu094
I was reading an article about LCCs and here is an excerpt that got me thinking.    While budget airlines cut other corners to keep fares low, they do not  — actually cannot — compromise the safety of their passengers in the  process.   What prevents low-cost carriers from cutting corners that might compromise the safety of their passengers?
What prevents Low Cost Carriers (LCCs) from cutting cost that compromise safety?
aviation.stackexchange.com
<safety><low-cost-carrier>
aviation.stackexchange.com/questions/56508
aviation.stackexchange.com/users/35156/hi there
The two main factors stopping Low Cost Airlines from undercutting to the extent they compromise safety are the law and aviation culture. The law ensures safety standards and countries can refuse airlines if they believe they are undercutting safety standards. Moreover, there is a culture of safety in the aviation industry and staff would not accept a situation where safety was compromised. An additional factor is that even one incident could be the end of the airline, as nobody would fly them anymore. The first reason that restricts LLCs on this matter is the law. Moreover, LLCs' reputation and the fact that people will not want to travel with them constitutes another reason. Suspension of AOC and frequent audits could also restrict them. Another possible reason is a possible ban from other countries, as well as the fines imposed that could put LLCs financial sustainability in danger. Finally, the culture of respect towards human life could also prevent LLCs from doing so. 
First reason is the law that restricts all airlines. LLCs reputation and the fact that people will not want to travel with them.  Suspension of AOC and frequent audits.  A possible ban from other countries. Fines and financial sustainability.  The culture of respect towards human life. 