"What you reap is what you sow."
Generally every human is has the rule of Karma. If you do good you will have good and if you do bad then you will have bad things happening in your life. Like Jaise Karni Waisi Bharni.
The Life story of Lord Ram and Devi Sita is quite painful. What are the reason they had to face these many problems in life.
I don't think it has any thing to do with karma. coz Lord Vishnu is not going to do any sinful act.