The only difference I see in your question is that you wrote "a hamburger" and "hamburger". So I'll discuss that.
Hamburger can mean two related things. (1) "Hamburger" can mean ground beef in general. "Ground" is the past tense and past participle of the verb "to grind" (break into small pieces). (2) "Hamburger" can also mean a sandwich made with a patty of ground beef (hamburger) and a bun. ("A "patty" can mean a round or square flat piece of meat. "Bun" has many meanings, but here it means a type of bread usually used to hold a hamburger or a hot dog".)
So when you are using "hamburger" to mean ground beef in general, "hamburger" is an uncountable noun: "I'm going to the butcher shop to buy hamburger (ground beef).
But when you use "hamburger" to mean a sandwich made with ground beef, "hamburger" is a countable noun: "I'm going to McDonald's to eat a hamburger."