Louis XIV, in building the palace, was intent on outdoing Vaux-le-Vicomte. Versailles became the home of the French nobility and the location of the royal court. Louis XIV, himself, lived here -- there were government offices here; as well as the homes of thousands of individuals. By insisting that nobles spend time at Versailles, Louis kept them from countering his efforts to centralize the French government.
While the Palace was grand and luxurious, it was also impossibly expensive to maintain. Historians estimate that maintaining the Palace, including the care and feeding of its staff and the Royal Family, consumed as much as 25% of the entire national income of the country of France.
After Louis XIV, several smaller buildings were added to the Versailles area by Louis XV and Louis XVI including the Grand Trianon, the Petit Trianon, and the Hamlet of Marie Antoinette.