Ankylosing Spondylitis is a disease that causes inflammation of the joints. Primarily the joints of the spine and the sacroiliacs.
Usually inflammation is a response of the body to an injury. Inflammation works to heal wounds, but it the case of inflammatory disease the body creates inflammation due to an excessive reaction of the immune system.
That will lead to pain and stiffness. Over time the inflammations will as well as affect ligaments and tendons and can lead to fusion of the bones because of the body natural response of healing (it will causes new bone to grow at the inflammation points). This process is called calcification.
This is why it's called Ankylosing Spondylitis, which means, Ankylosing = stifness, rigidity and Spondylitis = vertebrea