Just to make sure: the chains could not connect if they didn't have the same genesis file.
If you now connect the nodes to each other they have to reach consensus about what is the canonical chain. So they start to go through the regular consensus protocol which basically says that the longest (actually heaviest, but doesn't make a difference here) chain is the canonical chain. So as node1 has more blocks its blockchain becomes the canonical chain and node2's blockchain is essentially declared an uncle chain and transactions in those blocks are no longer valid.
Uncle blocks give mining rewards until 7th generation but unfortunately I haven't been able to find definite information about what happens to the 8th and onwards blocks. I assume they just stay in as uncle blocks without reward. Some more info for example here: https://ethereum.stackexchange.com/a/58003/31933
Transactions which end up in uncle blocks are reverted and they become available again in the transaction pool so some node should eventually pick them up and process them again. Of course if they are very old transactions the required preconditions (such as required Ether balance) might not exist anymore so they get reverted as valid non-successful transactions in the canonical chain.
If you had used same transactions in the same order until some point in the beginning the nodes would only discard (make as uncles) blocks starting from the first differentiating block. They wouldn't discard blocks which are the same in both chains (as long as all the blocks before those are also the same).