Computer chips can hold LOADS of data. You can get small USB sticks (aka dongles) that hold over 50 GB (gigabytes). And regular hard drives the same size as a slice of toast can hold 500 GB or more!
The Nintendo DS cartridges, though, actually don't hold much data for their size - I believe it's 256 MB (megabytes) on a cartridge. But the pokemon data itself doesn't take up much room. For example my database for all the content on this site is only a few MB!