The only way to hack into an iPhone from a computer is to install a spy application on the target device. When it is being installed, it doesn’t matter from which device another person accesses someone’s iPhone, be it a handset or a computer.
This is the Internet connection and a browser that matter. All the monitoring happens on the online account, created when spyware was purchased. So, a person accesses it and starts viewing everything about another one’s iPhone.