Having them in your party when you do certain choices affects their opinion of you. Like Shale didn't like that I turned down the cult (which would have given me the warrior Reaver class :( ), and I got like -4 to his opinion of me.
I'm not entirely sure, some seem to do it easier than others. Morrigan taught me Shapeshifter even though my standing wasn't that great with her, but I also hear she'll go to bed with male characters fairly early on as well. I have really high standing with Alistair and he was still rather reluctant to teach me Templar, but I found a booklet for it anyhow so I'm not sure how high exactly I needed to get.
As far as getting them to like you better goes, there are a few things you can do. First off, know what their personality is like. Try to figure out their views on things. Knowing this helps quite a bit. Then you can usually predict how they will react to your choices. Alistair, Leliana, and Wynne which is my current party really like to help others. They're very good people and anything that seems like a "good" option gets better standing with them. Morrigan and Shale are the opposite. They don't seem to like it when you help others, they have a more selfish outlook and believe you should do things only for yourself.
What I am getting at is that you should bring compatible party members together with you and make choices they would like. That will increase your standing with them quite a bit. There are also gifts, though you probably won't be able to get very high relying on gifts alone. Talking to them periodically works really well also, which is a main staple of Bioware games. Conversating with them opens up side quests with them and they generally open up to you a lot more.