In this case,
'p' is a pointer, initially you have make your pointer to point on address of variable 'a'.
now, if you want to access the value of 'a' through pointer then you have to use *p.
initially a = 10, and 'p' is pointing to a;
so now if you want to print the value of a, then you have to use either 'a' or *p.
now, you are doing *p = 30;
that means on the address of 'a' you are assigning value 30;
in Simple words, pointer can hold the address a and by pointer indirectly we can access that value.
i hope i have cleared you doubt.