It does not make sense to look at individual factors like this. A job interview is not a list of targets that one has to be compared with, and if one candidate scores higher on average than the next then they get the job. There is a myriad of factors into play. Some of them are quantifiable, most are not. Some of them are not even written anywhere, or conscious. Some of them depend on who exactly belongs to the committee, their state of mind at the time, and so on. It is extremely rare to be able to say "candidate X got the job over candidate Y because of this factor".
How large is the effect of the grant itself compared to secondary effects in determining who gets promoted, such as the fact that Alice is likely to be more productive thanks to having the funding, for example due to being able to hire more postdocs and PhD students?
What a strange question. The department is not going to hire someone and pay them for decades just so that they can get some overhead from someone's grant for the next few years. Yes, what you call the "side effects" of the grant (most people would call that the grant's purpose) is more important than the grant itself.
In other words, can Bob compensate for not having acquired the funding by writing just as many research papers or attracting self-funded PhD students, etc?
You don't get a job because you wrote as many papers as someone else. Writing a single, extremely influential paper can land you a job when writing ten average papers will get you squat.
Supervising students does not get you a job. Except in some fields that use students as cannon fodder for menial tasks, supervising a student is pretty much a net drain on your productivity. However, never having supervised students can be held against you during a job interview for senior positions; let's say that it's a necessary but not sufficient condition.
But yes, "Bob" (not sure why this hypothetical person has to be named, and gendered differently to boot) can "compensate" less funding by performing better on research. Academia has not yet reached the point where a researcher's main job is to attract funding. We are not startups. Research and teaching are still the goals.