Why is rice and pasta alternatives of potatoes?

They are both high in carbohydrates like potatoes and as they are widely available they can all be considered staple foods.