JavaCC create recursive decent parsers. This type of parsers work by looking at the next symbol to decide what rule to choose. By default they look at only the next symbol (lookahead=1). But you can configure the parser to look not only on the next but look at the next N symbols. If you set lookahead to 2 the generated parser will look at the next two symbols to decide what rule to choose. This way you can define your grammer mor natural (but at the cost of performance, the bigger the lookahead, the more the parser willl have to do).
If you set the general lookahead to a bigger number your parser will be slower for all inputs (for non trivial grammars). You can use lookahead local if you want to let the parser with lookahead=1 by default and use a bigger lookahead only on specific situtations.
http://www.engr.mun.ca/~theo/JavaCC-FAQ/javacc-faq-moz.htm#tth_sEc4.5
For example a parser with lookahead=1 can't decide which of the rules (1 or 2) to take, with lookahead=2 it can:
void rule0() : {} {
<ID> rule1()
| <ID> rule2()
}
You can change the difinition of the grammar to get the same result but use lookahead=1:
void rule0() : {} {
<ID> ( rule1() | rule2() )
}