The F-23 was stealthier, and had a better performance envelope than the F-22.
But the F-23 was from northrop, who has (as was thought at the time) just been awarded a 300 billion dollar contract to provide the airforce with up to 200 B2 stealth bombers, so the contract went to lockheed martin, more as a corporate welfare type support.
Unfortunately (or fortunately, depending on your POV), the airforce only ordered 22 B2s, making it not nearly as profitable as Northrop had hoped.