Ships are important targets for modern naval warfare detection and reconnaissance. The accurate detection of ships contributes to the maintenance of maritime rights and interests and the realisation of naval strategy. Synthetic Aperture Radar (SAR) image detection tasks play a vital role in ship detection, which has consistently been a research hotspot in the field of SAR processing. Although significant progress has been achieved in SAR ship detection techniques using deep learning methods, some challenges still persist. Natural images and SAR images significantly diverge in imaging mechanisms and scattering characteristics. In complex background environments, ships exhibit multiscale variations and dense arrangements, and numerous small-sized ships may be present, culminating in false or missed detections. To address these issues, we propose a novel SAR ship detection network, namely, a Wavelet-Driven Feature-Enhanced Attention–You Only Look Once X (WDFA-YOLOX) network. Firstly, we propose a Wavelet Cascade Residual (WCR) module based on the traditional image processing technique wavelet transform, which is embedded within an improved Spatial Pyramid Pooling (SPP) module, culminating in the formation of the effective wavelet transform-based SPP module (WSPP). The WSPP compensates for the loss of fine-grained feature information during pooling, enhancing the capability of the network to detect ships amidst complex background interference. Secondly, a Global and Local Feature Attention Enhancement (GLFAE) module is proposed, leveraging a parallel structure that combines convolutional modules with transformer modules to reduce the effect of irrelevant information and effectively strengthens valid features associated with small-sized ships, resulting in a reduction in false negatives in small-sized ship detection. Finally, a novel loss function, the Chebyshev distance-generalised IoU loss function, is proposed to significantly enhance both the precision of the detection box and the network convergence speed. To support our approach, we performed thorough experiments on the SSDD and HRSID, achieving an average precision (AP) of 99.11% and 96.20%, respectively, in ship detection. The experimental results demonstrate that WDFA-YOLOX has significant advantages in terms of detection accuracy, generalisation capability, and detection speed and can effectively realise more accurate detection in SAR images, consistently exhibiting superior performance and application value in SAR ship detection.