A company that earned 5M last year, with a million shares outstanding, had earnings per share of 5. At this price, investors are willing to pay 10 for every 1 of last year's earnings. Some analysts will exclude one-time gains or losses from a quarterly earnings report when computing this figure, others will include it. For example, if a company has a lot of products in the pipeline, I wouldn't mind paying a large multiple of its current earnings to buy the stock.
PE is a much better comparison of the value of a stock than the price.
You are paying more for the 10 stock's future earnings stream. The 10 stock is probably a small company with an exciting product with few competitors. The 100 stock is probably pretty staid - maybe a buggy whip manufacturer.