Note: While you can cook rice with no water left, it is actually quite a bad idea.
Rice, in raw state, has some chemicals outside made by the farmers to protect against insects and the like.
If you drain the rice, these chemicals are mostly washed off, while if you boil it until there is no water left, all these chemicals stay inside.
Also draining makes it easier, since you don't need to worry about the rice getting burnt.