When your buttock muscle needs to contract at a high force, while it is in a stretched position, it leads to overload and small microscopic tears in the gluteal muscle fibers. A small bundle of fibers can tear, or large deep tears can split fibers along the length of the gluteal muscles. Your nervous system will react by contracting the muscle and increasing the muscle tension to protect itself. This results in a temporary shortening of the muscle to allow healing to take place.
When you go into a position where you stretch or contract your gluteal muscles, you will feel a sharp stinging feeling. This is because the more you stretch it, the more you damage the scar, which is trying to heal the muscle fibers. It is like picking at a scab and not allowing it to heal.
Movements like bending forward to pick up something from the floor, or sitting down from standing, will stretch the gluteal muscles and cause buttock pain. Pain when contracting the gluteus muscles involves standing up out of a chair, therefore the deeper the seat, the more the pain. Even walking up stairs puts the guleus muscles under full tension while at stretch & under full load.
Gluteal strains usually occur due to a sudden contraction of the gluteal muscles, often when they are in a stretched position. This sometimes occurs with rapid acceleration while running, especially up-hills, or when performing an explosive jump, or when lifting excessive weight e.g. loaded squats or lunges in the gym. This can lead to Gluteus Maximus or Gluteus Medius pain.