In films, the hacker simply plugs in there generic windows laptop the the device to be “hacked” even if that is an alien space ship, which wouldn’t have the correct socket, voltage levels, number of digital pins, may not even use electricity, not have a std protocol, not use a std operating system, work at a different frequency etc etc etc, and presses a button. 3 secs later after the laptop screen has shown some wizzy graphics, the device is “hacked” and the hacker has complete and full control over that device…..
If you’re referring to Independence Day, the best explanation i saw was that the Area 51 craft was studied and became the origins of human computing systems. Therefore, there was some compatibility between Geoff Goldblum’s laptop and the mothership.