They are more likely to give you an autograph when they know that you know who they are, this way they know you will appreciate their signature.
Common courtesy is always important.
They like it when you treat them decently. Places to get autographs are important. The best way is obviously to have a front row seat and to get to the game early, but it is very difficult to get great seats. So capitalize on such an opportunity by talking to players as they walk by to get balls on the dirt. Try to make small talk while down there as teammates notice them talking to you and follow suit coming by to talk to them and you.