there are questions you can ask yourself that might help you deduce the problem,
1. Is it a high alcohol beer? because this would imply that the yeast will have a harder time to ferment,
2. Are you racking your beer onto the priming sugar dissolved in water(which is the most consistent way to prime)? <-but this one mostly matters for unequal carbonation
3. Are you using enough sugar, or at least a consistent amount with the batches that turn out right?
4. Are you conditioning at room temperature? the colder the beer the more time it takes for the beer to carbonate. Sometimes an undercarbonated brew just need a couple more weeks to be ready. I prepared the caribou slobber batch from NB back in May, but to my dismay it was flat. I was so close to pouring it out but I got lazy and just left it there. A month and a half later it was pretty good IMO.