its not random, m atk was never big influencer of heals (if it was, you would see bishops running with demon staffs+12)
what influences healing by quite some margin is tier and grade of weapon as far as i remember, that means if 2 weapons have same m atk but 1 is top B grade and second is top C grade, the B grade one should heal more
same goes for tier, if 2 weapons have same m atk, but one is low C and other is top C, the top C should be healing more
take note that i tested this like years ago on this server so anything could change from what i just wrote, but generally what you want for healig efficiency was always top tier top grade weapon, which didnt have to be enchanted