The computer's iTunes knows it is a different iPad because iTunes will read the serial number on the iPad when the device is connected to the computer and with iTunes running.
You can give your iPad a different name as well in Settings>General>About>Name.
You didn't mess anything up on the other iPad since iTunes knows which iPad is which. You can configure your sync settings for both iPads in order to sync the exact content that you want to put on each device. You don't have to let iTunes sync content that you don't want on your devices. You can make the changes yourself.
iOS: Syncing with iTunes