Is digitalWrite(pinnumber,LOW) different from ground pin I am using Tinkercad simulator, but an unusual thing happened. When I connect one wire of dc motor to pin 9 with digitalWrite(9,HIGH) and other wire to ground, the motor runs with rpm of 5555.

void setup()
{
  pinMode(9, OUTPUT);
} 

void loop()
{
  digitalWrite(9, 1);
}


But instead if I connect the other wire to pin 13(say) and set digitalWrite(13,LOW) the motor runs at an rpm of 3846.

void setup()
{
  pinMode(9, OUTPUT);
  pinMode(13, OUTPUT);
} 

void loop()
{
  digitalWrite(9, 1);
  digitalWrite(13,0);
}


Can anyone explain this?
Yes, it is different.

First: Never run a motor directly from IO pins - you will damage your Arduino. Not only can a real Arduino not supply enough current, but motors generate a lot of back-EMF that will kill an Arduino.

Secondly a pin doesn't connect direct to GND or VCC - it is connected through a MOSFET that performs the switching.  That MOSFET has an ON resistance, which causes a voltage drop across it determined by the current being sourced or sunk through the pin.

You can read more about GPIO pins here.