The ultimate goal is both to memorize and to keep references to useful snippets or quirks I may need in the future - I actually use them very frequently (it's a format that tends not to be useful to the general public, though).
In the long term, some subjects become small books. Amusingly, by far, the largest notebook is Rust - around 15k words, and I am still an advanced beginner (!).
I really miss a program that is very good for both editing and viewing Markdown! I currently use an always-open VSC; reading Markdown is ok, but not super convenient.