public is an access modifier.
Virtual is a keyword as you correctly indicated, though neither refer to any .NET library in particular. They don’t refer to any attributes and it wouldn’t be correct to call them attributes for that matter. Attributes are distinctly different.
How does they internally work?
Please refer to the links provided above.
Does they call any code or any attributes from .Net class library?
No, as stated already they’re distinctly different from attributes and are not associated with any .NET library.
solved Underlying structure and behavior of modifiers in C#