Inspired by this: https://www.reddit.com/r/AskHistorians/comments/ja4ye2/ancient_egypt_was_clearly_a_highly_advanced/ (actually one of the removed top level comments)
I could probably speculate and say something wrong here in order to encourage Cunningham's Law to take effect, so pretend I did.
I'm just genuinely curious about the context of when and why each one was used, and I realized that I had some pretty strong assumptions that I don't have any specific citation for. I'm especially curious about edge cases or exceptions, but I think that's human nature.
The hieroglyphic writing system was typically used for monumental inscriptions such as tomb biographies, temple inscriptions, and rock reliefs. Demotic was primarily used for legal and administrative texts like letters, contracts, tax receipts, petitions, wills, and so on, although it was used for literature as well.
There's always more to be said on the topic, but I wrote about the history of the Egyptian language and writing systems in How much did hieroglyphics change over time?