Two questions there:
In Trainspotting, why did each character get £4,000 during the deal if Mark put in £2,000 upfront? From the £16,000 they got surely they wouldn't each get £4k if Mark contributed £2k to buy the gear from Swanny's friend?
Because SickBoy and Begbie are sociopaths - and Begbie is prone to violent outbursts. Renton didn't even want to be involved in the deal, but did so out of fear and for the same reason agreed to the unfair split.
And how did Spud know to go to the locker to get his share left by Mark at the end?
Obviously, Renton got a message and the key to Spud after he had put the money in there.