@CrazyEnimal, please insert your code inside a code block in forum posts.
You can use SQL in ProcessWire when it suits you. That's what the $database API variable is for.
Here is one way you could get a listing of manufacturers with the number of occurrences within a selection of cars.
// Get the IDs of the cars
$car_ids = $pages->findIDs("parent=$parent, template=page_car, dealer=$dealer_id");
// Get table for manufacturer Page Reference field
$table = $fields->get('manufacturer')->getTable();
// Get manufacturers that are selected in the car pages
$query = $database->query("SELECT data FROM $table WHERE pages_id IN (" . implode(',', $car_ids) . ")");
$manufacturer_ids = $query->fetchAll(\PDO::FETCH_COLUMN);
// Count how many times each manufacturer occurs in the results
$manufacturer_occurrences = array_count_values($manufacturer_ids);
// Sort the results in order of occurrences, highest to lowest
arsort($manufacturer_occurrences);
// Get the manufacturer pages
$manufacturers = $pages->getById(array_keys($manufacturer_occurrences));
// Output a list of manufacturer titles and the number of occurrences
foreach($manufacturers as $manufacturer) {
echo "<p>{$manufacturer->title} ({$manufacturer_occurrences[$manufacturers->id]})</p>";
}