Higher level charm and relationship are the main decider
Roguery, leadership, character traits, trade will sometimes pop up in the options and if you meet the checks requirements then it boosts your chances even further (They will be color coded, green means you are getting the boost).
If you are flirting, make sure you have done quests for her family if you are in the same faction or saved them from a tough spot multiple times (Have them in your army, release them when close to enemy armies and join the fight). If they are your enemies then catch and release is your best option.
Some perks help with persuasion as well Antaeus gave you a good link to check them there.
If you are trying to recruit a lord. Your progress will be saved even if you failed, i am not sure if the same thing happens with flirting but i think it does. You will have to wait a while (I wish i knew exactly how long) before trying to persuade them again. The text might be misleading but don't give up
There is also the option of save/load but i would recommend working on relationship at least if you don't want to invest in charm even if you are going that way about it.