The biggest reason is a dirty air filter. Over time your air filter catches pollutants and other dust particles, once this builds up it restricts the overall air flow, as a result condensation from the air’s humidity will start freezing over the AC coils instead of dripping into the drip pan.
A refrigerant leak – If the refrigerant level is too low it will cause your evaporator coils to become too cold. Air that comes in contact with your evaporator coil will then end up freezing.
Problems with your AC’s fans cause cause the AC unit to freeze up.
Dirty air ducts will block airflow and also cause part of your AC unit to freeze up.