From 飴(あめ) (ame, “candy”) + 玉(たま) (tama, “ball”). The tama changes to dama as an instance of rendaku (連濁).
飴(あめ)玉(だま) • (amedama)