i think your question is why to play d6 and not castle first which would give you the option to play the Marshall too. The reason is following. After 0-0 white has the extra option of playing a4, the so called Antimarshall. black will need to play b4(or Rb8) and enter some lines he normally wouldnt like to play. When you play d6 first you can play Bd7 after a4 which is a really good move! So as a Marshall player you need to be prepared for a4 b4 and as a Spanish player you dont need to fear a4 when you play d6 first cause of Bd7(or b4).
Closed Ruy-Timing of ...d6

After 7...0-0
White has 5 playable moves.
The popular or higher winning percentage of the 5 are the moves
8.a4 which is the Anti-Marshall Attack.
or
8.h3 which can tranpose back into the mainline.
The Anti-Marshall can be rather annoying to play as black lol.
with 7...d6
You do avoid most of that stuff.
I-AM-YOUR-GRANDPA already gave some reasons why.
I do believe he left out you do have Na5 if white messes up as well.
After 7...d6 if they play 8.h3 than 8...Na5 is pretty good move. I know you mentioned it. However, it is always a nice point to add in.
However, going back to what you said about 8.d4.
If after 7...0-0 8.d4
I believe you can respond with 8...d6 which after 9.c3
You got the move 9...Bg4
Oh what an annoying bishop move that is.
I really hate that bishop pin!
From the white side oooooo its super annoying.
Than after a common move like 10.Be3 you can follow with 10...exd4 or even I have seen the move 10...Bh5.
Moving the bishop back with out being provoked.
OOOOOOOOO its super annoying.
They are really going to hate your guts.
Yeah I prevent this. No way I am going to play against that bishop pinn. It is so annoying.
Now check out the following moves.
After 7...d6 8.c3 always! If black decides to play 8...Bg4
OOOOOOOO Boy I love the bishop pinn than!
I got 2 moves I can play than.
9.d3
or
9.h3
OOOOOOO yeah and now my center is not under any fire at all. My D pawn is on d3 and not on d4. I am going after your bishop now.
OOOOO Yeah that is redemption!
It is a wonderful thing.
After a sequence of moves. Lets say I was to play 9.d3 for example
9...0-0 than white has the move 10.Nbd2
OOOOOO man my little queen side knight is now on a journey for redemption!
I'm coming after that ~bishop~!
Nf1 to g3 is going to hit that bishop smack him around from the A file to the H file.
An if black doesn't play 8...Bg4 and does the stand move 8...0-0
Than I continue with 9.h3
Never allowing such a pin
It is a wonderful thing!

i think your question is why to play d6 and not castle first which would give you the option to play the Marshall too. The reason is following. After 0-0 white has the extra option of playing a4, the so called Antimarshall. black will need to play b4(or Rb8) and enter some lines he normally wouldnt like to play. When you play d6 first you can play Bd7 after a4 which is a really good move! So as a Marshall player you need to be prepared for a4 b4 and as a Spanish player you dont need to fear a4 when you play d6 first cause of Bd7(or b4).
I don't see how playing d6 helps prevent a4, white can play it anyway and the Bd7 isn't particularly good either(statistically or computer eval-wise).
And xplayer, all your garble was just either answering things irrelevant to my question or already stating what i said in a more annoying way.

After reviewing the lines and some home analysis of my own. I believe the difference between the two variations is very very subtle difference.
I looked at the position after the following moves:
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6
After the above set of moves. I found if white proceeds with 8.a4
Black has a few more options at his disposal than in the 7...O-O continuation.
8.Bg4, 8.Bd7, 8.Bb7, and 8.b4
I looked at the position after the following moves:
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 O-O
After the above set of moves. I found if white proceeds with 8.a4
Black has fewer options.
8.Bb7 and 8.b4
Which upon review of these position's. I believe their is a very very subtle difference.
The difference is by playing d6 you allow your light square bishop more flexiblity and opportunity which it would not normally have in the other variation.
Furthermore, After the move 7...d6 you defend the e5 pawn.
Unleashing a very subtle threat of capturing white's light square bishop with Na5 moves.
A threat which is not seen in the 7...O-O continuation mind you. Which could say it keeps some pressure on white.
If your opponent does not respond to the threat you can take out the bishop pair. If your opponent proceeds with 8.a4 in this position.
It seems clear to me you have more options than in the previous line.
If you proceed with 7...O-O instead of 7...d6. You will have the option of playing an extra line which is known as the Marshall Attack. Which could be seen as a benefit for delaying the move d6.
However, You do not add any pressure on white since their bishop is not in danger and you also limit your options on your Light Square Bishop placement if they chose to go down the 8.a4 route.
It could be seen as a double edge gamble!
However, I did look at some of the continuation which get played out. If you respond with b4. I found those lines can tranpose. From my understanding as of yet. Obviously further investigation will have to be done to determine whether or not this is completely accurate. However, On brief review it seems possible that they can tranpose in both continuation.
I did go through some of the continuation I-AM-YOUR-GRANDPA was talking about with Bd7. It does seem very much playable. I haven't gone through the whole line yet. However, the little I have went through seems playable.
With out hearing from GM's I guess that is the best difference I got.
A very very subtle one.

i already gave you the answer, d6 is just for players who play the closed Ruy anyway and want to have more options to deal with a4. And no Bd7 is good, i have the repertoire of 2 GMs, one being chess24 mod Jan Gustaffson. Dont look at comp evaluations anyway, thats garbage.

i already gave you the answer, d6 is just for players who play the closed Ruy anyway and want to have more options to deal with a4. And no Bd7 is good, i have the repertoire of 2 GMs, one being chess24 mod Jan Gustaffson. Dont look at comp evaluations anyway, thats garbage.
I know computer evals are largely worthless in the opening, but I still don't quite see how playing d6 on move 7 seems to "prevent" a4, I wasn't saying that Bd7 is bad or anything, I just don't see how it can be any sort of deterrent to white playing a4 in those pawn structures.

It doesnt prevent it. There is no move which can prevent a4, the thing is just that you have much more options to deal with it, whilst when you play 0-0 instead of d6 you are more or less forced to play b4. Of course b4 isnt bad but when you want to play the closed Ruy anyway there is no point in castling first because it doesnt give you any extra option. After a4 Bd7 is considered to be the easiest reply although b4 is good too of course. You always have the choice between b4 and holding the pawn on b5 but when you wanna hold it on b5 then Bd7 is the way to do it because Bb7 is a strategical mistake after white plays with d3, blocking out the bishop.
It doesnt prevent it. There is no move which can prevent a4, the thing is just that you have much more options to deal with it, whilst when you play 0-0 instead of d6 you are more or less forced to play b4. Of course b4 isnt bad but when you want to play the closed Ruy anyway there is no point in castling first because it doesnt give you any extra option. After a4 Bd7 is considered to be the easiest reply although b4 is good too of course. You always have the choice between b4 and holding the pawn on b5 but when you wanna hold it on b5 then Bd7 is the way to do it because Bb7 is a strategical mistake after white plays with d3, blocking out the bishop.

It doesnt prevent it. There is no move which can prevent a4, the thing is just that you have much more options to deal with it, whilst when you play 0-0 instead of d6 you are more or less forced to play b4. Of course b4 isnt bad but when you want to play the closed Ruy anyway there is no point in castling first because it doesnt give you any extra option. After a4 Bd7 is considered to be the easiest reply although b4 is good too of course. You always have the choice between b4 and holding the pawn on b5 but when you wanna hold it on b5 then Bd7 is the way to do it because Bb7 is a strategical mistake after white plays with d3, blocking out the bishop.
I do see now that playing d6 earlier gives black more choices to deal with the a4 move, but I don't think Bd7 is necessarily the best choice...Bg4 seems more annoying for white to deal with(and databases seem to support its results a little more), but flexibility is what I'm looking for, and I guess playing 7...d6 actually gives more flexibility than castling first. I don't ever plan on playing the Marshall(I think most gambit lines are gimmicky, even the good ones like the marshall), I just wanted to try and keep white off guard as much as possible. Thanks for your input man.
Can anyone give me the reason that d6 is usually played on move 7 for those who don't plan on playing the marshall? Why not castle on move 7 like in the marshall line but give a little more flexibility and only commit the pawn to d6 on move 8? I don't quite see the utility in preventing 8.d4 with the threat of ...Bg4, as white would just enter the bogolyubov line anyways with 9.c3 which isn't particularly strong. Is the timing of 7..d6 purely to threaten ...Na5? Any other input on the timings of 0-0 and d6/d5 in the closed?