There is a huge wealth of analytic devices available for mapping segmental sequences into prosodic structures, so many in fact that some people would like to eliminate some of those devices as unnecessary. The past 40+ years of phonological analysis have made it clear that you can always pick some object to get rid of, as long as you use some other entity.
The treatment of intervocalic consonants is one of those analytically-variable things. Virtually everything that enters into that computation can itself be the product of a phonological computation. Sonority can be computed from syllable structure and segmental features. Syllable structure can be mostly computed from segmental features, with a little help from foot structure. But foot structure can be computed from something else.
One of the first controversies regarding intervocalic consonants is how to parse them into syllables in English. Is "hammer" syllabified as "ham" plus "mer" (m is both coda of σ1 and onset of σ2), is it "ha" plus "mer", or is it "ham" plus "er"? And how does this play out in the rules of consonant-allophony (lack of aspiration in "happy, later")? Insofar as it has long been known that stress is relevant to consonant-allophony and that a definitive analysis of "happy" implies a particular analysis of "hammer", some people have added the "foot" as an entity in the analysis of intervocalic consonants.
The theory of CV phonology took a sort of scorched-earth policy to these questions, and simply eliminated all of that higher-level paraphernalia – if only has "C" and "V", and certain kind of relationship between segments and C-V elements, no syllables, feet, onsets, margins, codas. Its main proponent (Scheer) has also, for reasons unclear to me, included something along the lines of "sonority".
The point here is that in terms of prosody, you can compute anything from something else. We don't try to compute basic vowel quality of consonant distinctions from other things, because of the ample set of minimal pairs like "heed, head, had...; heat, hat....". Prosody is not generally a thing mandatorily entered into the lexicon, except for segmental length (nonexistent for consonants in English, controversial for vowels) and stress position (in English, which is atypical among languages and where valient efforts have been undertaken to predict where the stress falls). You might then decide you don't even need a construct "syllable" or "onset", so it would be meaningless to assign an intervocalic consonant to one entity vs. another. Maybe you could compute onset position from sonority, but how do you compute sonority? So to make you question more general, why should you compute any putative relationship at all? Usually, it is a consequence of a decision about what entities must exist in the analytic armory, and what entities should not exist.