The build tool allows you to build the project, not only compile and run a program.
In learning environment, where you have few files, you can just compile and run using javac and java command.
But in real life world, you have hundreds/thousands of files, lots of third party jars which you require to run the project, lots of property files etc.
The build tools helps you to maintain these things in an organised manner and finally build the application in the form you expect, i.e. war or zip or some other format as per your requirement to deploy the project.
Ant is very powerfull project management too.
You can start learning Ant from their documentation, can be found in apache site.
How to use build tool ant as i have never used any build tool and how is it better then just compiling and running our programe using javac and java.
You can try to read either Pro Apache Ant or Ant: the definitive guide (both links goes to Books Google where you can read quite large portion of either book). Personally I prefer Maven (that is another build tool). More resources on tools can be found in this post