In the following video, it explains how the robots are capable of flying, making different acrobatics and even handle fault conditions in the main rotors.
This kind of technology usually involves mathematical models to develop working algorithms. A famous quote of Laplace, a French successful mathematician currently related with control theory, was about the possibility —for a superior intelligence— of creating a single equation to describe all the movements of the entire universe, with atoms included.
One of the techniques today involves the use of something called «impulse response». Basically, it's like launching something to a system in specific conditions and analyze the behavior, or in other words the available numerical data about it. With the Laplace transform, it's possible to create a «transfer function» and develop a mathematical model of the system.
The information above is only a bit of the field, but perhaps you'll find interesting since it's in general state of the art!