Quickbooks desktop is for businesses that want everything to be "in house" on their own server or have no need for mobile access to their accounting information. They may want specific features for different departments or certain information from those departments. They may want a more detailed customized report criteria to be part of their financial portfolio. They may want specialized things on their paperwork or need it to look a certain way. Perhaps they aren't comfortable having their financial data online and worry about security? There are all kinds of reasons a business uses the desktop version.
Quickbooks online is for businesses that may have people on the move and need to access the books on the go. Or they may not have a physical location for their business but still need to keep track of transactions.
While the two are the same in what it does, there are different reasons for using one vs. the other.