Found in many permanent hair color products in varying strengths, ammonia is a very strong, alkaline chemical ingredient that creates a chemical interaction with the developer to lift color from the hair.
If you lie on your back while you sleep this could cause hair stress leading to split ends in the back. To avoid hair stress tie hair back using a soft scrunchie band.