Merchandizing, which also involves exploiting labor and investments, which involve exploiting the market. Also, it’s not like she personally sold the books, low-wage bookstore employees sold them while she promoted them. Anyway, she would have pulled 10% on the net profit, probably a little more over time, and the total book sales in USD are ~$7.7 billion. So let’s say that’s entirely profit (it’s not), that’s $770 million as of 2017. She allegedly made her first billion in 2005. It literally couldn’t have been from book sales.
Harry Potter: How JK Rowling's story became a multi-billion-dollar entertainment franchise

How did a seemingly simple story of a young wizard struggling to conquer a powerful magical foe become a global franchise worth upwards of $US24 billion (in muggle money)?

ABC News

She allegedly made her first billion in 2005. It literally couldn’t have been from book sales.

Why not? The first Harry Potter novel was released in 1997. By 2005, 8 years later, she has release 6 of the 7 Harry Potter books.