For background, -라고 in 밥 먹으라고 (말)하다, 가라고 하다 is an imperative quote form for most verbs except 이다 and 아니다. -다고 is a descriptive quote form for all verbs.
(descriptive, general) 밥(을) 먹는다고 한다 = They say they are eating.
(descriptive, 이다/아니다) 서울은 한국에서 제일 큰 도시라고 한다 = They say Seoul is the largest city in Korea.
(imperative, general) 밥 먹으라고 한다 = They are telling you/us to eat.
(이다 / 아니다 cannot take an imperative form)
The imperative form can contract in two ways. Generally we say -란다 (라고 한다), -래요 (-라고 해요), etc. but we end the sentence with -라고 when repeating an order or request (this is like quoting what you just said yourself).
- 엄마가 밥 먹으래 (Mom's telling us to eat) = quotes what someone else said.
- 밥 먹으라고 (I said (you should) eat) = repeats what you have said yourself.
#2 is typically used when the other person didn't hear you and you're repeating what you just said. We can't say 밥 먹으래 in such a case because -(으)래 is strictly for quoting someone else. It is also unnatural and less clear to say the same sentence over again, so the second time we just shorten it to -라고.
To summarize, in normal situations of telling/asking someone to do something, you use the full sentence like 밥 먹어, 밥 먹어라 or 식사하세요, but if you're saying it the second time for whatever reason, you'd say 밥 먹으라고 or 식사하시라고요 to make it shorter and clearer.
This pattern also applies to the descriptive quote forms (e.g. saying 날씨가 춥다고 when the other person didn't it hear the first time).