Think like this:
All nouns in Japanese are uncountable. You can't count apples any more than you count water or light. Thus under Japanese grammar you always have to say "two 'objects' of apple", "four 'sticks' of banana" and "seven 'bodies' of dog", as if they are "two bottles of water" or "four rays of light" etc.
りんご一つ／一個 an object of apple = an apple (fruit)
りんご一山 a lot/pile of apples
りんご一年分 a year's worth of apples
りんご一本 a stick of apple = an appletree
The only exception is a few words represent shapes, (abstract) groupings, unit of measure etc. that could be used as counter words as well.
三試合 three matches/games
十世帯 ten households
三十メートル thirty meters
Why is the numeral(or numeral and counter) after the particle を? If it is part of the thing, why is it not on the other side?
Because they are adverbs, unlike English, where numerals are used like adjectives. We prefer saying "give me apples in three" or "kids are playing in three", instead of "give me three apples" or "three kids are playing". They can basically appear anywhere after the base word and before the verb (but can be restricted by context, such as nesting or other countable words).
[numeral] の [noun] type of expression does exist too, but it only sounds natural in some limited settings. Generally, it's able to be translated as "the [numeral] [noun]s" such as:
三匹の子ぶた The Three Little Pigs
But in many cases when this expression would be valid, you'd only see a numeral (and counter) alone rather than its full form, because in such cases the base word is very likely to be stated already, thus simply omitted for that time.