Basic theoretical foundations and insights on bilevel models and their applications to power systems