The first, /etc/default/grub is the one you should edit. The second one, /boot/grub/grub.cfg, is produced by runing update-grub. There are comments in the beginning of each of those files reminding you of which is which. It mentions grub-mkconfig but that's a program that is run by update-grub.
The first one only has rather permanent information that tell update-grub what you want. The second merges that information with what operating systems you had on your system at the time you ran update-grub and is what grub itself uses to produce the boot menu.
To see information on using the /etc/default/grub use the
info -f grub -n 'Simple configuration' command.
Most people don't have to mess with any of this. When Ubuntu is installed it puts something reasonable in /etc/default/grub and that is that.