The order of the tags is determined by the popularity of each tag (how many questions they're used on).
The most popular tag is the one used in the title.
The tags don't need to be ordered by popularity. They didn't used to be. But it's kinda nice, if for no other reason than folks who try typing their questions into the tag field are immediately faced with a scrambled mess upon posting.
The most popular tag doesn't need to be the one used in the title. But the idea is that this is a strategy that'll help Google find it. If you had to rely on users putting the most relevant tag first in order to make this work, you'd probably end up with a lot of noise.
This way people can help out with SEO and make sure people browsing questions on a busy site can in the first tag get an idea of what topic a person is talking about
I highly doubt most users care about SEOing their question. But if you do, all you have to do is put the keywords in the title! Work 'em in conversationally if at all possible though, or it's gonna look like crap to the human readers (the ones actually answering your question).