The cameras are in the stands and the system is based on error proofing. They use high speed cameras, but they need the data from a number of cameras to have any form of accuracy. The centralised computer processes the images and then triangulates the position of the ball.
The issues are twofold the whole of the ball has to cross the line and modern balls compress on impact. So my guess would be that the algorithm they use is looking for daylight between the ball and goal line on numerous cameras.
What made this situation unusual is that the keeper had his hands on the ball, the post would have obscured cameras on that side and the villa defenders head obscures the view from above and his shirt obscures the view from the side away from the post.
VAR ideally should have overruled and awarded the goal, but I am not sure that is part of their remit.