In 玉ねぎ, the prefix 玉- distinguishes big, round onions from long, thin scallions, which are simply called negi.
Negi has a kanji, 葱, but people usually use hiragana or katakana for that word. Similarly, you could write tamanegi as 玉葱, but few do.
One more onion-related note: The colloquial English phrase “to know one’s onions” means “to know one’s subject or job well.” I’d never heard that before writing today’s blog!