An inertial frame of reference is a frame of reference which is not externally accelerated. This is somewhat of a (typically physical) idealization, because no such thing exists in our universe (we are in the gravitational field of the earth, which rotates about its axis, and about the sun, while the solar system rotates about the center of our galaxy, etc.). But you can imagine two people in a well-shielded box, somewhere in outer space where no gravity is present. Intuitively, you probably agree that - while these two people can do an experiment to determine that they are moving with respect to each other - there is no way that they can tell which one is moving and which one is standing still (if any), without any "external" reference points. Indeed, this is precisely one of the postulates of relativity.
In more practical terms, suppose that I am in a train which moves at constant velocity and you are in another train which is standing still. When I look out the window, and our trains are very close together so I can't see any "external" reference points such as the platform or the station building, I may be inclined to think that I am the one standing still, and the other train is actually moving; while you may think that you are standing still and I am moving. (This actually happened to me more than once while I was in a train). In fact, without looking at something outside the trains, there is no experiment we could do to determine which of us were moving... or maybe both.
About the thought experiment with the lightning bolt, I think you got that backwards. One other postulate of SR is that light (in vacuum) always moves at the same velocity to any (inertial) observer. So when I am in the middle of the train, and the lightning hits both ends simultaneously, it will have to travel half the distance of the train from both ends. Since that takes the same time, I will see them arrive simultaneously. For someone outside the train, however, this is not the case. While the flash from the rear of the train moves towards the middle, the middle is moving forward. So the distance the light has to travel increases. Similarly, the middle of the train is moving towards the position where the front of the train was when the lightning struck, so the front flash has to travel less distance to me. So when you are on the platform watching me, and also see both flashes of light moving at constant velocity, the one at the back will arrive at me later then the one on the front, simply because it has to cover more distance.