We looked into this in great detail years ago, but for specific countries (ie not Spain and Italy). My memory is: Your friends company (Company A) is now an employer in Spain and Italy. They have employees, not contractors, so very different obligations. They have requirements as an employer in both places that depend on the country's own regulations. They are eligible for playing employer PRSI (equivalent) and ensuring employee payroll taxes are deducted and paid to local authorities (probably). There may also be wider problems about the fact that their company can be viewed as having a subsidiary in those countries, because work is being done there on a permanent basis. This could - potentially - be an issue in terms of corporation tax.
Its very complicated, where the other country is is an issue, and there are companies that help you out with this. A friend of mine set up a permanent overseas working arrangement here in Ireland before COVID, her firm uses a company that basically takes her salary from her employers (plus whatever fee they charge) ensures her taxes are paid to revenue and she gets a payslip as she should etc etc and neither the company nor her has to worry about it any more. But its really not straightforward, and I think a lot of people may end up being stung by this in the future. Your friend needs to get proper advise ASAP.