Ratios are basically fractions, two things in relation to each other in a sense. The ratio of green apples to red apples is basically green apples/red apples or green apples:red apples.
Therefore the ratio would be 18:21 but when you simplify, dividing by 3, you get 6:7 or 6/7 green apples to red apples.