Britains policy on its navy was always to have a navy stronger than the second and third strongest navies combined. However during the beginning of ww2 they had focused heavily on battleships and destroyers, not knowing that aircraft carriers would be the capital ships of 20th century warfare. The Japanese had a smaller navy but they focused on having light and heavy aircraft carriers.
It wasn’t until the sinking of the battleships HMS Prince of Wales and HMS Repulse in Dec 10th 1941 that the world really woke up to the potential of aircraft carriers. That battle saw Japan sink two unescorted British battleships while only losing 18 men. Churchill would later say that the sinking of those battleships was the greatest shock he had during the entire war.
So was the Japanese Navy actually superior to the British during the beginning of the war and was the British Navy obsolete since they didn’t focus on aircraft carriers?
The Royal Navy had not focused on battleships; in fact, in September 1939, they had more carriers than the Imperial Japanese Navy did, though most of the British ones were smaller. To count them, the British had seven (Furious, Argus, Hermes, Eagle, Courageous, Glorious and Ark Royal) while the Japanese had six (Hosho, Akagi, Kaga, Ryujo, Soryu and Hiryu). The British had also not been operating on the so-called 'Two-Power Standard', where the RN was to be maintained at at least the combined strengths of the two next largest navies. This had been abandoned following WWI, thanks to a combination of defence cuts, pacifist politics and the international arms control treaties of the 1920s and 1930s. However, as war loomed in the latter half of the 1930s and the treaty systems fell apart, a 'New Standard' became the centre of naval planning. The New Standard called for a major expansion of the RN, to allow it to fight a simultaneous war against the Axis powers in Europe and Asia. The RN projected that to do this, it would need 20 battleships and 14 carriers, plus a large force of cruisers and destroyers. However, these could not be immediately be brought into service; the RN expected that it would be up to the New Standard by 1942 at the earliest. As a final note, the power of aircraft carriers was generally understood before the loss of Force Z. British carriers had sunk three Italian battleships at Taranto in November 1940, and immobilised the German battleship Bismarck in May 1942, allowing the British battleships to catch her; Force Z, meanwhile, had been sunk by land-based aircraft, not carrier aircraft.
In 1939, neither the RN nor the IJN saw the carrier as the centrepiece of the fleet. Both saw it as a key part of the fleet, which was expected to use a combined-arms approach. However, their tactical planning diverged in several key ways. The British intended to concentrate their carriers with the battlefleet. This was largely a defensive measure; the carriers would benefit from the additional anti-aircraft gunfire of the battleships, while it would make it easier for the carrier's fighters to support the battleships. However, it did make it easier to concentrate strikes for massed attacks on an enemy fleet. This was tried in a number of exercises in the 1920s and 1930s, but it is unclear how much the RN actually included it in their actual doctrines - due to a combination of war losses and the fleet being widely stretched, the RN was rarely able to operate multiple carriers together. The RN's battle-fleet doctrine of 1939, as laid down in the 1939 'Fighting Instructions', assigned the carrier four main roles: finding the enemy fleet, sinking the enemy's carriers, to slow and damage the enemy battlefleet, and to observe the fall of shot for the battleships. Once the enemy carrier force had been defeated, and their battlefleet slowed by carrier attacks, the British battlefleet would seek to fight a surface action. Once it had closed with the enemy, the carriers would drop out of the combined force. The battleships were to close to ~15,000 yards, and then engage. They would deploy in separate divisions, ensuring that the enemy was always at a positional disadvantage to part of the British fleet. The RN put a large emphasis on the need to fight at night. They saw the older ships of their fleet as being somewhat technologically inferior compared to the other major navies, due to a lack of investment in modernisation in the 1920s and 1930s. Night action would level the playing field was preferred for battlefleet actions, and the RN was therefore the only one of the major navies of the period to train its full fleet in night fighting. They used this experience to good effect at battles like Cape Matapan. The Fleet Air Arm (responsible for flying aircraft from British carriers) also developed the ability to launch strikes at night, which was unique in the period.
In 1939, the Japanese planned to operate their carriers ahead of the battlefleet. Like the British, they saw the primary role of the carrier as locating the enemy fleet, destroying his carriers, and then harassing his battlefleet, as part of a combined-arms fleet, but felt that the best way for this to happen was to encircle the enemy fleet with their carriers. This extended the range of their scouting and ensured that a single attack could not destroy the entire Japanese carrier force. Over the next two years, experiments and exercises would lead to a shift towards concentrating the carrier force, which would allow for devastating massed strikes, but this was not part of their doctrine in 1939. The ideal Japanese battle would start with the Japanese submarine screen spotting the enemy fleet. The enemy fleet would then be worn down by submarine, air and night torpedo attacks. Once contact with the enemy battlefleet was made, the Japanese battleships would fight a long-range gunnery duel (ranges of 35,000 yards or more), before closing to a 'decisive range' of 19-22,000 yards to finish the enemy off. Only light forces - cruisers and destroyers - were expected to fight at night, with the battleships expected to fight a day action.
On a technical level, both fleets had areas where they were ahead. In terms of carrier aircraft, the RN was largely hampered by the focus on aircraft that were stable, low-performance and easy to land. This was a result of the fact that the FAA was controlled by the RAF in the interwar period; this meant that the RN had little idea about what aircraft could do, limiting it when it was setting the specifications for new aircraft, while the RAF was unwilling to pay for large numbers of aircraft, meaning that the FAA couldn't waste aircraft by crashing them. The Japanese B5N1 'Kate' torpedo bomber was faster and more manoeuvrable than its British counterpart in the Fairey Swordfish (which was still a very effective aircraft in the RN's desired night strikes). The British Blackburn Skua was intended to be a fighter and dive-bomber; as a dive-bomber, it was comparable to the Japanese D3A1 'Val', but as a fighter it was heavily outclassed by most modern aircraft. The Japanese A5M 'Claude' and the British Sea Gladiator were roughly capable as fighters ('Claude' was faster, but Sea Gladiator was more manoeuvrable), but the Sea Gladiator had been procured primarily to defend naval bases - it only rarely operated from carriers. As noted above, Britain had more carriers available, and was producing more than Japan was, but these ships largely carried a smaller air group than the Japanese carriers. Britain did have one big advantage though, which was radar. Type 79 air search radar had been fitted to several ships in 1939; with it, British fighters could be effectively controlled to intercept and engage shadowers and incoming raids. The Japanese did not have this capability, which meant that their fighter screens were highly porous - Japanese carrier groups suffered from surprise air attacks on in the Indian Ocean and at Midway in 1942.
Beyond carriers, the two fleets' ships were fairly comparable. The two British Nelson-class battleships outclassed every Japanese battleship in service in 1939, and the modernised battlecruiser Renown was an excellent carrier escort, with a high speed and a heavy AA battery. The modernised Queen Elizabeth-class ship Warspite was highly capable, with two more ships of the class undergoing conversion to a similar standard. The Japanese battleships, though, were more powerful than the unmodernised British ships of the 'R' and Queen Elizabeth classes. The Japanese had more heavy cruisers, armed with 8in guns, though the British 6in cruisers of the 'Town' class were arguably more effective in real conditions. British and Japanese destroyers were similarly comparable; the Japanese had a better torpedo armament, with longer-ranged torpedoes, but again these proved to be relatively ineffective in real conditions. One area where Britain was clearly ahead was in anti-submarine warfare. Japan saw ASW as a second-line activity, leading to doctrinal flaws. ASW defence was the responsibility of individual defence districts, meaning that there was no centralised response to submarine threats, and no way to coordinate convoys. They also neglected ASW technology, leaving the IJN without effective sensors or weapons for attacking subs. The British, through the ASW school at Portland, had developed a fairly effective ASW doctrine that worked well when exposed to threats. Japan had effective subs, but these were hampered by a doctrine that tied them too closely to the battlefleet; Britain's subs were equally effective, but had a more flexible doctrine.
So, an important note: no battleship at sea was sunk solely by carrier based aircraft until the sinking of Musashi in 1944. Prior to that, carrier aircraft had sunk battleships at anchor (Arizona, Oklahoma, West Virginia, California, and Nevada at Pearl Harbor and Conte di Cavour, Littorio, and Duilio at Taranto), crippled them enabling their destruction by surface ships (Bismarck) or finishing off capital ships that had been crippled in surface engagements (Hiei), but never a battleship at sea without the aid of surface vessels. Furthermore, the aircraft which destroyed Prince of Wales and Repulse were Type 97 and Type 1 land based attack bombers of the Genzan, Kanoya, Mihoro Air Groups, which were not even capable of being launched from a carrier. While the loss of Force Z off Malaya did indicate that unescorted capital ships were indeed vulnerable to air attack, it meant nothing for carriers, which had so far shown themselves as highly capable raiders. It is also odd that you seem to suggest that the British were unaware of the potential impact of carriers, when the British had been the ones who helped inspire the massed carrier raid on Pearl Harbor via the Royal Navy's own highly successful raid on Taranto in November 1940, where torpedo bombers operating off of Illustrious had crippled three Italian battleships--including the brand new Littorio--as well as the contributions of Formidable to the Battle of Cape Matapan, where torpedo bombers from that carrier severely damaged Vittorio Veneto, and crippled Pola, enabling the destruction of the latter along with her sisters Fiume and Zara in a surface night action, not to mention the famous story of Bismarck. The British were well aware of the potential of carrier aircraft.
The Imperial Japanese Navy also did not really focus on carriers in the way you seem to be implying. While the IJN certainly saw great value in carriers, and likely had the world's best carrier air arm in 1941, the Japanese did not consider carriers to be the decisive arm of engagement. While some officers within the IJN (not including Admiral Yamamoto) were air power zealots who advocated scrapping the battlefleet in favor of more carriers, they were not dominant. The Japanese Navy's carrier doctrine focused on using the massed striking power of their carriers to overwhelm and destroy the enemy's carriers from beyond the enemy's effective range, not as the decisive engagement, but as a necessary prelude to the actual decisive battle to ensure the Japanese would have air superiority over the area of the decisive battle and to enable Japanese carrier aircraft to harass the enemy's battlefleet, hopefully slowing and disrupting it prior to the actual decisive battle. The Navy's land based bomber force was supposed to assist in this by harassing and attriting the enemy fleet as it made its way across the Pacific. The Japanese assumed that their likely opponent would be the Americans sailing west from Pearl Harbor, but a British fleet sailing north from Singapore would have undoubtedly met with the same attentions. Depending on how the engagement played out, the Japanese would ideally seek an initial night engagement by light forces (including their heavy cruisers and the battlecruisers/battleships of the Kongō class to break through the enemy's screening forces and clear a path for the destroyers) to deliver a crippling blow via torpedo attack, followed by an early morning surface action to finish off the remnants. If the IJN was unable to fight the night battle, it would have relied on its air superiority and long range gunnery, combined with torpedo attacks, to cripple the enemy before closing range to finish off the enemy's battle fleet. Interestingly, the destroyer was as much a focus for the IJN as anything else, as the Japanese put great faith in the power of the destroyer as a torpedo attack platform. Notably, in the plans for a night battle, the Japanese plan would call for the sacrifice of their heavy cruisers and even fast battleships if it meant clearing a path for the destroyers to make a torpedo attack. Regardless, the IJN remained doctrinally focused on the decisiveness of a surface engagement between capital ships, and while the IJNs carriers were a powerful supporting element of this doctrine, the carriers remained exactly that: a support for the battlefleet.
Comparing between the two, there were definitely areas where one side excelled. The Japanese carrier fleet was exceptionally capable and its aircraft likely outclassed their Fleet Air Arm counterparts. Japanese carriers would also have larger air wings than most of their Royal Navy counterparts, either due to their small size (early carriers like Hermes and the Courageous class conversions) or the armored flight decks of Illustrious and her sisters. However, the armored decks of the Illustrious class carriers would have rendered their decks proof against the 250 kg bombs of Japanese dive bombers. However, British carriers were unique in that they were capable of night operations, which the Japanese were not. I will not engage in speculation, but in terms of carriers, it's clear that each side had advantages and disadvantages and it's not as though the British had completely ignored carriers. In terms of surface forces, while the Japanese did train for gunnery engagements at longer ranges than the British, the British and Japanese battlelines were roughly comparable with an advantage to the Royal Navy, which had an advantage in numbers and firepower, while the Japanese batteline was faster, though the British battlercruiser squadron likely outclassed the Japanese fast battleships. The Japanese likely did have a significant advantage in torpedoes, with the Type 93 both more powerful and longer ranged than anything in the British arsenal. The biggest disadvantage the British would face is that they would be unable to mass their full forces to face the concentrated Japanese fleet, as the British would have to leave many ships behind to keep an eye on both the Italian and German surface fleets. It is definitely worth noting that the ongoing war in Europe tieing down such significant amounts of forces from the European colonial powers that enabled the Japanese to be as aggressive as they were in 1940 and 1941. Had the German and Italian surface fleets not been occupying the attention of the Royal Navy, the Japanese would no doubt had to have been much more cautious in their diplomatic posture and initial operations.
I hope this helps to demonstrate that--in many ways--your question is starting from a false premise, with faulty assumptions on the focuses and capabilities of both the Imperial Japanese Navy and the Royal Navy. Please feel free to ask any follow ups you may have.
Britains policy on its navy was always to have a navy stronger than the second and third strongest navies combined.
As a final smaller note I do want to correct some misconceptions present in this statement, especially as it relates to the RN in 1939.
In essence the 2 Power Standard had been dead for 20 years come WW2.
It had been something of an informal rule for the second half of the 1800's in British naval procurement, and formalized in Naval Defence Act of 1889. Which itself included a massive budget for additional construction of multiple types of warships.
However the Anglo-German Dreadnought "race" would become something of a new beast and each years naval estimates were spiralling out of control, though it only really became a fixture of public discourse from 1908-to 1913 or so. And during this time the reality of the situation was Britain building to a 1.5 or "1 and some spares" standard in modern capital ships to match Germany.
So then what finally changes things?
Well the Washington Naval Treaty! The 1922 Agreement placed broad limits on different kinds of ships that made up the navies of the world. And in Capital Ship tonnage the UK accepted rough parity with the United States and a modest superiority over Japan in a 5:5:3 ratio, with France and Italy trailing behind.
The UK for the most part abided by the spirit of the treaty, and the arms race that appeared to be a possibility with the United States, which would have broken the bank, was averted, along with a political win for the disarmarment movement post WW1.
With the collapse of the treaty system in the years before WW2, the Royal Navy did begin aggressive expansion programs again, but even smaller warships take months to years from design to construction, to being ready for actual service.