How Cantonese and Mandarin writing can be identical
First, Cantonese is rarely written. In the few places where Written Cantonese is used, yes, each syllable is always one character (though for some words, like 乜嘢、唔好、即係, people often say multiple characters together so fast that it may sound like one syllable).

Each Chinese character has a defined pronunciation in Cantonese (sometimes a character has multiple pronunciations in different contexts), and there are often certain predictable patterns between the Cantonese and Mandarin pronunciations of the same character. And the pronunciation of a word is simply the pronunciation of each character concatenated. That means that if you take a word written in Mandarin, and read it literally in Cantonese, it will be pronounced with the same number of syllables as in Mandarin, and moreover the pronunciation will be based on the Cantonese pronunciation of each character, which is often somewhat related to the Mandarin pronunciation.

However, that may not be the way that that thing is usually said in Cantonese. In such cases, the way that people usually say that thing in Cantonese is considered a different word, and in Written Cantonese is written with different characters (which may or may not be the same number of characters that Mandarin uses). These are basically vocabulary differences between Mandarin and Cantonese.

Many commonly-used verbs, nouns, adjectives, adverbs, will have different vocabulary between Mandarin and Cantonese. But if you consider all words overall, the number of differences is small, and most words will be the same in Mandarin and Cantonese (as in written with the same characters, though the pronunciation of those characters will still be different). The vocabulary for "apple" is not different between Mandarin and Cantonese.