In Democratic countries -- the people would bite for presidential candidates alongside their party. When the votes are counted up, the MPs are also elected for their roles in their parties. Altogether, when all the votes are counted the president is elected (because they got the highest votes). However this does not apply to dictatorships in countries (where presidents are elected independently, without votes)